Seite 1 von 1

Problem mit setuptools

Verfasst: Dienstag 24. Oktober 2017, 21:04
von Lou Cyphr3
Ich möchte mir pytmx installieren, aber die setuptools werden immer nicht gefunden, obwohl das Terminal die erfolgreiche Installation bestätigt.
Liegt das an der 36.6.0 Version?

Code: Alles auswählen

 100% |████████████████████████████████| 481kB 617kB/s 
Installing collected packages: setuptools
  Found existing installation: setuptools 20.7.0
    Uninstalling setuptools-20.7.0:
      Successfully uninstalled setuptools-20.7.0
Successfully installed setuptools-36.6.0
*****@***** ~/Schreibtisch $ pip install pytmx
Collecting pytmx
  Using cached PyTMX-3.21.3.tar.gz
Could not import setuptools which is required to install from a source distribution.
Please install setuptools.
*****@***** ~/Schreibtisch $ sudo pip install -U pip setuptools
The directory '/home/*****/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/*****/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Requirement already up-to-date: pip in /usr/local/lib/python2.7/dist-packages/pip-9.0.1-py2.7.egg
Requirement already up-to-date: setuptools in /usr/local/lib/python2.7/dist-packages
*****@***** ~/Schreibtisch $ pip install -U pip setuptools
Requirement already up-to-date: pip in /home/*****/.local/lib/python3.5/site-packages
Collecting setuptools
  Using cached setuptools-36.6.0-py2.py3-none-any.whl
Installing collected packages: setuptools
Exception:
Traceback (most recent call last):
  File "/home/*****/.local/lib/python3.5/site-packages/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/home/*****/.local/lib/python3.5/site-packages/pip/commands/install.py", line 342, in run
    prefix=options.prefix_path,
  File "/home/*****/.local/lib/python3.5/site-packages/pip/req/req_set.py", line 784, in install
    **kwargs
  File "/home/*****/.local/lib/python3.5/site-packages/pip/req/req_install.py", line 851, in install
    self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
  File "/home/*****/.local/lib/python3.5/site-packages/pip/req/req_install.py", line 1064, in move_wheel_files
    isolated=self.isolated,
  File "/home/*****/.local/lib/python3.5/site-packages/pip/wheel.py", line 345, in move_wheel_files
    clobber(source, lib_dir, True)
  File "/home/*****/.local/lib/python3.5/site-packages/pip/wheel.py", line 323, in clobber
    shutil.copyfile(srcfile, destfile)
  File "/usr/lib/python3.5/shutil.py", line 115, in copyfile
    with open(dst, 'wb') as fdst:
PermissionError: [Errno 13] Keine Berechtigung: '/usr/local/lib/python3.5/dist-packages/easy_install.py'
*****@***** ~/Schreibtisch $ sudo pip install -U pip setuptools
The directory '/home/*****/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/*****/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Requirement already up-to-date: pip in /usr/local/lib/python2.7/dist-packages/pip-9.0.1-py2.7.egg
Requirement already up-to-date: setuptools in /usr/local/lib/python2.7/dist-packages
*****@***** ~/Schreibtisch $ sudo -H pip install -U pip setuptools
Requirement already up-to-date: pip in /usr/local/lib/python2.7/dist-packages/pip-9.0.1-py2.7.egg
Requirement already up-to-date: setuptools in /usr/local/lib/python2.7/dist-packages
*****@***** ~/Schreibtisch $ pip install pytmx
Collecting pytmx
  Using cached PyTMX-3.21.3.tar.gz
Could not import setuptools which is required to install from a source distribution.
Please install setuptools.

Re: Problem mit setuptools

Verfasst: Dienstag 24. Oktober 2017, 22:11
von __deets__
Ich sehe nur das du da mit Python 2.7 und 3.5 wild durcheinander gehst. Das sauber zu trennen und nachzuvollziehen was wohin installiert wird ist Schritt 1.

Re: Problem mit setuptools

Verfasst: Dienstag 24. Oktober 2017, 22:23
von Lou Cyphr3
Gut das war ein wenig durcheinander. Jedenfalls ist Python2.7 für mich gerade weniger interessant. Zum einen weil da die setuptools stimmen, zum anderen weil ich sie bei python3 brauche. Mal nur das betrachtet ist mein pip up to date aber meine setuptools werden trotzalledem nicht importiert
[codebox=bash file=Unbenannt.bsh]*****@***** ~ $ pip install --upgrade pip
Requirement already up-to-date: pip in ./.local/lib/python3.5/site-packages
*****@***** ~ $ pip3 install pytmx
Collecting pytmx
Using cached PyTMX-3.21.3.tar.gz
Could not import setuptools which is required to install from a source distribution.
Please install setuptools.[/code]

Re: Problem mit setuptools

Verfasst: Dienstag 24. Oktober 2017, 22:54
von __deets__
Mal pip, mal pip3. Warum? Sind das dieselben? Benutz mal volle Pfade für die executables. Starte Python & Versuch mal setuptools zu importieren. Wenn das geht, wo lebt das?

Re: Problem mit setuptools

Verfasst: Dienstag 24. Oktober 2017, 23:43
von Lou Cyphr3
Ich war der annahme das pip für alle versionen gilt. Als das nicht funktionierte hab ich es mit pip3 versucht.
Wenn ich python öffne, kann ich setuptools nicht importieren.

[codebox=bash file=Unbenannt.bsh]Python 3.5.2 (default, Sep 14 2017, 22:51:06)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import setuptools
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named 'setuptools'
>>>
[/code]

Re: Problem mit setuptools

Verfasst: Mittwoch 25. Oktober 2017, 08:05
von __deets__
Du musst schon den pip für genau die Version verwenden. Wie soll denn sonst ein Kommando für alle gelten? Du gibst ja nicht an, auf welches Python ein install sich bezieht.

Ich glaube man kann auch „python-m pip“ statt pip schreiben. Versuch das mit dem konkreten gewünschten Python.

Problem mit pytmx

Verfasst: Mittwoch 8. November 2017, 00:42
von Lou Cyphr3
setuptools, sowie pytmx sind mittlerweile installiert.

nun hab ich noch ein kleines Problem aus dem ich nicht schlau werde. Und zwar wird meine tilemap, welche ich mit pytmx laden will,
nicht geladen, stattdessen kommt dieser Fehler:

[codebox=text file=Unbenannt.txt]Traceback (most recent call last):
File "test1.py", line 116, in <module>
g = Game()
File "test1.py", line 32, in __init__
self.load_data()
File "test1.py", line 39, in load_data
self.map = TiledMap(path.join(map_folder, 'mappp.tmx'))
File "/home/*****/Schreibtisch/python/load test/tilemap1.py", line 22, in __init__
tm = pytmx.load_pygame(filename, pixelalpha=True)
File "/usr/local/lib/python3.5/dist-packages/pytmx/util_pygame.py", line 121, in load_pygame
return pytmx.TiledMap(filename, *args, **kwargs)
File "/usr/local/lib/python3.5/dist-packages/pytmx/pytmx.py", line 300, in __init__
self.parse_xml(ElementTree.parse(self.filename).getroot())
File "/usr/local/lib/python3.5/dist-packages/pytmx/pytmx.py", line 362, in parse_xml
self.reload_images()
File "/usr/local/lib/python3.5/dist-packages/pytmx/pytmx.py", line 385, in reload_images
loader = self.image_loader(path, colorkey, tileset=ts)
File "/usr/local/lib/python3.5/dist-packages/pytmx/util_pygame.py", line 80, in pygame_image_loader
image = pygame.image.load(filename)
pygame.error: Couldn't open maps1/../../tilesets/Images/Image_Resources/Original/Ground_Obstacles.png
[/code]

woran liegt es, dass die tilemap nicht geladen wird, am Pfad?

tiled

Verfasst: Mittwoch 8. November 2017, 01:46
von Lou Cyphr3
Ich hab das Problem gefunden. Wenn man mit Tiled(benutztes Programm) eine .tmx erstellt und diese später verschiebt, hat die erstellte .tmx Schwierigkeiten zu laden. Also ein Tiledproblem und keins von python/pygame.