Installation von Modulen mit Pip schlägt fehl

Probleme bei der Installation?
Antworten
Eicer
User
Beiträge: 4
Registriert: Sonntag 6. Oktober 2019, 09:42

Hallo Forum,
ich bin absoluter Neuling mit Python. Ich habe mir die aktuelle Version für Windows heruntergeladen. Ich möchte gern ein fertiges Tool nutzen, das auf Python basiert. In der Anleitung steht, dass dafür 2 Module requests und Babelfish benötigt werden. Diese sollen wie folgt installiert werden:

"python3 -m pip install requests" (or "python3 -m pip install --user requests" if you don't have admin rights on your machine).

Beide Varianten habe ich getestet, bekomme aber immer angezeigt, dass bei pip ein Fehler ist "invalid syntax". Mehr wird mir leider nicht angezeigt. Wie kann ich die beiden Module zum Laufen bekommen?

Vielen Dank im voraus,
Eicer
__deets__
User
Beiträge: 14542
Registriert: Mittwoch 14. Oktober 2015, 14:29

Du musst pip in der Shell/Eimgabeaufforderung aufrufen. NICHT den Python Interpreter starten und es dann eingeben.
Eicer
User
Beiträge: 4
Registriert: Sonntag 6. Oktober 2019, 09:42

Vielen Dank für die schnelle Antwort. Wenn ich die zuvor genannten Befehle im CMD aufrufe, passiert keinerlei Rückmeldung. Kann ich davon ausgehen, dass sie dann installiert sind? Auch wenn ich das eigently Python-Skript in der Shell starte, passiert nichts. Ist das so korrekt?
Benutzeravatar
sparrow
User
Beiträge: 4195
Registriert: Freitag 17. April 2009, 10:28

Bei dem entsprechenden Aufruf laufen Informationen durch und am Ende gbt es eine "Successfully installed" gefolgt von allen instalierten Modulen.
Ob es korrekt ist, dass bei dem eigentlichen Python-Script nichts passiert, kann niemand wissen, der das Script nicht kennt.
__deets__
User
Beiträge: 14542
Registriert: Mittwoch 14. Oktober 2015, 14:29

Na gar keine Rückmeldung klingt komisch. Und das Skript kenne ich nicht. Ob das was ausgeben soll oder nicht weiß ich also nicht. Allerdings sollte es ne Menge ausgeben wenn ein notwendiges Modul nicht gefunden wird.
Eicer
User
Beiträge: 4
Registriert: Sonntag 6. Oktober 2019, 09:42

sparrow hat geschrieben: Sonntag 6. Oktober 2019, 19:58 Bei dem entsprechenden Aufruf laufen Informationen durch und am Ende gbt es eine "Successfully installed" gefolgt von allen instalierten Modulen.
Ob es korrekt ist, dass bei dem eigentlichen Python-Script nichts passiert, kann niemand wissen, der das Script nicht kennt.
Dann scheint es bei mir nicht korrekt durchgelaufen zu sein. Da ich keinen Screenshot anhängen kann, hier die beiden Eingaben (ohne weitere Rückmeldung) der Commandbox:
C:\Users\Born>python3 -m pip install requests

C:\Users\Born>python3 -m pip install --user requests

C:\Users\Born>
Wie kann ich erkennen, ob die Module korrekt installiert wurden?
Eicer
User
Beiträge: 4
Registriert: Sonntag 6. Oktober 2019, 09:42

Ich habe jetzt herausgefunden, woran es liegt. Wenn ich nicht CMD, sondern die PowerShell nehme, dann bekomme ich auch entsprechende Meldungen bei der Installation. Das Skript läuft ebenfalls. Problem ist also behoben.
10211291
User
Beiträge: 25
Registriert: Montag 8. Juli 2019, 10:51
Wohnort: Berlin

Hallo,

Ich habe ein ähnliches Problem, arbeite unter macOS Cataline 10.15 mit

/Library/Frameworks/Python.framework/Versions/3.8/bin/python3

. Ich möchte mit pip3 matplotlib installieren und erhalte den Fehler "pkg-config is not installed". Was soll ich tun? pkg-config installieren?

Hier der Code:

Laptop-JCL:desktop user1$ pip3 install matplotlib
Collecting matplotlib
Downloading https://files.pythonhosted.org/packages ... 1.1.tar.gz (37.8MB)
|████████████████████████████████| 37.8MB 324kB/s
Collecting cycler>=0.10
Downloading https://files.pythonhosted.org/packages ... ne-any.whl
Collecting kiwisolver>=1.0.1
Downloading https://files.pythonhosted.org/packages ... 1.0.tar.gz
Collecting pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1
Downloading https://files.pythonhosted.org/packages ... ne-any.whl (65kB)
|████████████████████████████████| 71kB 537kB/s
Collecting python-dateutil>=2.1
Using cached https://files.pythonhosted.org/packages ... ne-any.whl
Collecting numpy>=1.11
Downloading https://files.pythonhosted.org/packages ... x86_64.whl (15.1MB)
|████████████████████████████████| 15.1MB 604kB/s
Collecting six
Using cached https://files.pythonhosted.org/packages ... ne-any.whl
Requirement already satisfied: setuptools in /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages (from kiwisolver>=1.0.1->matplotlib) (41.4.0)
Building wheels for collected packages: matplotlib, kiwisolver
Building wheel for matplotlib (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /Library/Frameworks/Python.framework/Versions/3.8/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/72/2myyzpcn6psbbv2cfdrxv9sm0000gn/T/pip-install-3cjfnwk1/matplotlib/setup.py'"'"'; __file__='"'"'/private/var/folders/72/2myyzpcn6psbbv2cfdrxv9sm0000gn/T/pip-install-3cjfnwk1/matplotlib/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /private/var/folders/72/2myyzpcn6psbbv2cfdrxv9sm0000gn/T/pip-wheel-_f7ywf7u --python-tag cp38
cwd: /private/var/folders/72/2myyzpcn6psbbv2cfdrxv9sm0000gn/T/pip-install-3cjfnwk1/matplotlib/
Complete output (506 lines):
IMPORTANT WARNING:
pkg-config is not installed.
matplotlib may not be able to find some of its dependencies
__deets__
User
Beiträge: 14542
Registriert: Mittwoch 14. Oktober 2015, 14:29

Ich würde nicht Python 3.8 empfehlen. Das ist zu neu. Da scheinen Pakete nicht fertig vorzuliegen, und damit müssten die dann selbst kompiliert werden. Das ist nichts was man mal so eben macht, wenn man keine Ahnung hat. Und auf Catalina upzugraden war auch kein guter Move. Dafür gibt es vieles auch noch nicht.

Versuch mal 3.7. Vielleicht hast du da mehr Glück. Wenn nicht, nimm homebrew. Und schau ob die matplotlib haben.
10211291
User
Beiträge: 25
Registriert: Montag 8. Juli 2019, 10:51
Wohnort: Berlin

Danke ich probiere die Vorschläge.

Es treten aber auch unter Windows Fehler auf. Hat hier jemand eine Idee?
Betriebssystem: Microsoft Windows [Version 10.0.17763.805]
Version: Python 3.8.0

Code: Alles auswählen

C:\Users\user1>pip install matplotlib
Collecting matplotlib
  Using cached https://files.pythonhosted.org/packages/12/d1/7b12cd79c791348cb0c78ce6e7d16bd72992f13c9f1e8e43d2725a6d8adf/matplotlib-3.1.1.tar.gz
    ERROR: Command errored out with exit status 1:
     command: 'c:\users\user1\appdata\local\programs\python\python38-32\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\user1\\AppData\\Local\\Temp\\pip-install-mer9iuas\\matplotlib\\setup.py'"'"'; __file__='"'"'C:\\Users\\user1\\AppData\\Local\\Temp\\pip-install-mer9iuas\\matplotlib\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\user1\AppData\Local\Temp\pip-install-mer9iuas\matplotlib\pip-egg-info'
         cwd: C:\Users\user1\AppData\Local\Temp\pip-install-mer9iuas\matplotlib\
    Complete output (205 lines):
    ================================================================================
    Edit setup.cfg to change the build options

    BUILDING MATPLOTLIB
      matplotlib: yes [3.1.1]
          python: yes [3.8.0 (tags/v3.8.0:fa919fd, Oct 14 2019, 19:21:23) [MSC
                      v.1916 32 bit (Intel)]]
        platform: yes [win32]

    OPTIONAL SUBPACKAGES
     sample_data: yes [installing]
           tests: no  [skipping due to configuration]

    OPTIONAL BACKEND EXTENSIONS
             agg: yes [installing]
           tkagg: yes [installing; run-time loading from Python Tcl/Tk]
          macosx: no  [Mac OS-X only]

    OPTIONAL PACKAGE DATA
            dlls: no  [skipping due to configuration]

    Could not locate executable g77
    Could not locate executable f77
    Could not locate executable ifort
    Could not locate executable ifl
    Could not locate executable f90
    Could not locate executable DF
    Could not locate executable efl
    Could not locate executable gfortran
    Could not locate executable f95
    Could not locate executable g95
    Could not locate executable efort
    Could not locate executable efc
    Could not locate executable flang
    don't know how to compile Fortran code on platform 'nt'
    Der Befehl "svnversion" ist entweder falsch geschrieben oder
    konnte nicht gefunden werden.
    non-existing path in 'numpy\\distutils': 'site.cfg'
    Running from numpy source directory.
    C:\Users\user1\AppData\Local\Temp\easy_install-uk90cjv2\numpy-1.17.3\setup.py:418: UserWarning: Unrecognized setuptools command, proceeding with generating Cython sources and expanding templates
      run_build = parse_setuppy_commands()
    C:\Users\user1\AppData\Local\Temp\easy_install-uk90cjv2\numpy-1.17.3\numpy\distutils\system_info.py:690: UserWarning:
        Optimized (vendor) Blas libraries are not found.
        Falls back to netlib Blas library which has worse performance.
        A better performance should be easily gained by switching
        Blas library.
      self.calc_info()
    C:\Users\user1\AppData\Local\Temp\easy_install-uk90cjv2\numpy-1.17.3\numpy\distutils\system_info.py:690: UserWarning:
        Blas (http://www.netlib.org/blas/) libraries not found.
        Directories to search for the libraries can be specified in the
        numpy/distutils/site.cfg file (section [blas]) or by setting
        the BLAS environment variable.
      self.calc_info()
    C:\Users\user1\AppData\Local\Temp\easy_install-uk90cjv2\numpy-1.17.3\numpy\distutils\system_info.py:690: UserWarning:
        Blas (http://www.netlib.org/blas/) sources not found.
        Directories to search for the sources can be specified in the
        numpy/distutils/site.cfg file (section [blas_src]) or by setting
        the BLAS_SRC environment variable.
      self.calc_info()
    C:\Users\user1\AppData\Local\Temp\easy_install-uk90cjv2\numpy-1.17.3\numpy\distutils\system_info.py:1712: UserWarning:
        Lapack (http://www.netlib.org/lapack/) libraries not found.
        Directories to search for the libraries can be specified in the
        numpy/distutils/site.cfg file (section [lapack]) or by setting
        the LAPACK environment variable.
      if getattr(self, '_calc_info_{}'.format(lapack))():
   C:\Users\user1\AppData\Local\Temp\easy_install-uk90cjv2\numpy-1.17.3\numpy\distutils\system_info.py:1712: UserWarning:
        Lapack (http://www.netlib.org/lapack/) sources not found.
        Directories to search for the sources can be specified in the
        numpy/distutils/site.cfg file (section [lapack_src]) or by setting
        the LAPACK_SRC environment variable.
      if getattr(self, '_calc_info_{}'.format(lapack))():
    c:\users\user1\appdata\local\programs\python\python38-32\lib\distutils\dist.py:274: UserWarning: Unknown distribution option: 'define_macros'
      warnings.warn(msg)
    Traceback (most recent call last):
      File "c:\users\user1\appdata\local\programs\python\python38-32\lib\site-packages\setuptools\msvc.py", line 489, in _find_latest_available_vc_ver
        return self.find_available_vc_vers()[-1]
    IndexError: list index out of range

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "c:\users\user1\appdata\local\programs\python\python38-32\lib\distutils\core.py", line 148, in setup
        dist.run_commands()
      File "c:\users\user1\appdata\local\programs\python\python38-32\lib\distutils\dist.py", line 966, in run_commands
        self.run_command(cmd)
      File "c:\users\user1\appdata\local\programs\python\python38-32\lib\distutils\dist.py", line 985, in run_command
        cmd_obj.run()
      File "c:\users\user1\appdata\local\programs\python\python38-32\lib\site-packages\setuptools\command\bdist_egg.py", line 163, in run
        self.run_command("egg_info")
      File "c:\users\user1\appdata\local\programs\python\python38-32\lib\distutils\cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "c:\users\user1\appdata\local\programs\python\python38-32\lib\distutils\dist.py", line 985, in run_command
        cmd_obj.run()
      File "C:\Users\user1\AppData\Local\Temp\easy_install-uk90cjv2\numpy-1.17.3\numpy\distutils\command\egg_info.py", line 26, in run
      File "c:\users\user1\appdata\local\programs\python\python38-32\lib\distutils\cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "c:\users\user1\appdata\local\programs\python\python38-32\lib\distutils\dist.py", line 985, in run_command
        cmd_obj.run()
      File "C:\Users\user1\AppData\Local\Temp\easy_install-uk90cjv2\numpy-1.17.3\numpy\distutils\command\build_src.py", line 142, in run
      File "C:\Users\user1\AppData\Local\Temp\easy_install-uk90cjv2\numpy-1.17.3\numpy\distutils\command\build_src.py", line 153, in build_sources
      File "C:\Users\user1\AppData\Local\Temp\easy_install-uk90cjv2\numpy-1.17.3\numpy\distutils\command\build_src.py", line 286, in build_library_sources
      File "C:\Users\user1\AppData\Local\Temp\easy_install-uk90cjv2\numpy-1.17.3\numpy\distutils\command\build_src.py", line 369, in generate_sources
      File "numpy\core\setup.py", line 667, in get_mathlib_info
      File "c:\users\user1\appdata\local\programs\python\python38-32\lib\distutils\command\config.py", line 241, in try_link
        self._check_compiler()
      File "C:\Users\user1\AppData\Local\Temp\easy_install-uk90cjv2\numpy-1.17.3\numpy\distutils\command\config.py", line 54, in _check_compiler
      File "c:\users\user1\appdata\local\programs\python\python38-32\lib\distutils\_msvccompiler.py", line 253, in initialize
        vc_env = _get_vc_env(plat_spec)
      File "c:\users\user1\appdata\local\programs\python\python38-32\lib\site-packages\setuptools\msvc.py", line 185, in msvc14_get_vc_env
        return EnvironmentInfo(plat_spec, vc_min_ver=14.0).return_env()
      File "c:\users\user1\appdata\local\programs\python\python38-32\lib\site-packages\setuptools\msvc.py", line 843, in __init__
        self.si = SystemInfo(self.ri, vc_ver)
      File "c:\users\user1\appdata\local\programs\python\python38-32\lib\site-packages\setuptools\msvc.py", line 485, in __init__
        self.vc_ver = vc_ver or self._find_latest_available_vc_ver()
      File "c:\users\user1\appdata\local\programs\python\python38-32\lib\site-packages\setuptools\msvc.py", line 492, in _find_latest_available_vc_ver
        raise distutils.errors.DistutilsPlatformError(err)
    distutils.errors.DistutilsPlatformError: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "c:\users\user1\appdata\local\programs\python\python38-32\lib\site-packages\setuptools\sandbox.py", line 154, in save_modules
        yield saved
      File "c:\users\user1\appdata\local\programs\python\python38-32\lib\site-packages\setuptools\sandbox.py", line 195, in setup_context
        yield
      File "c:\users\user1\appdata\local\programs\python\python38-32\lib\site-packages\setuptools\sandbox.py", line 250, in run_setup
        _execfile(setup_script, ns)
      File "c:\users\user1\appdata\local\programs\python\python38-32\lib\site-packages\setuptools\sandbox.py", line 45, in _execfile
        exec(code, globals, locals)
      File "C:\Users\user1\AppData\Local\Temp\easy_install-uk90cjv2\numpy-1.17.3\setup.py", line 443, in <module>
      File "C:\Users\user1\AppData\Local\Temp\easy_install-uk90cjv2\numpy-1.17.3\setup.py", line 435, in setup_package
      File "C:\Users\user1\AppData\Local\Temp\easy_install-uk90cjv2\numpy-1.17.3\numpy\distutils\core.py", line 171, in setup
      File "c:\users\user1\appdata\local\programs\python\python38-32\lib\site-packages\setuptools\__init__.py", line 145, in setup
        return distutils.core.setup(**attrs)
      File "c:\users\user1\appdata\local\programs\python\python38-32\lib\distutils\core.py", line 163, in setup
        raise SystemExit("error: " + str(msg))
    SystemExit: error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "c:\users\user1\appdata\local\programs\python\python38-32\lib\site-packages\setuptools\command\easy_install.py", line 1144, in run_setup
        run_setup(setup_script, args)
      File "c:\users\user1\appdata\local\programs\python\python38-32\lib\site-packages\setuptools\sandbox.py", line 253, in run_setup
        raise
      File "c:\users\user1\appdata\local\programs\python\python38-32\lib\contextlib.py", line 131, in __exit__
        self.gen.throw(type, value, traceback)
      File "c:\users\user1\appdata\local\programs\python\python38-32\lib\site-packages\setuptools\sandbox.py", line 195, in setup_context
        yield
      File "c:\users\user1\appdata\local\programs\python\python38-32\lib\contextlib.py", line 131, in __exit__
        self.gen.throw(type, value, traceback)
      File "c:\users\user1\appdata\local\programs\python\python38-32\lib\site-packages\setuptools\sandbox.py", line 166, in save_modules
        saved_exc.resume()
      File "c:\users\user1\appdata\local\programs\python\python38-32\lib\site-packages\setuptools\sandbox.py", line 141, in resume
        six.reraise(type, exc, self._tb)
      File "c:\users\user1\appdata\local\programs\python\python38-32\lib\site-packages\setuptools\_vendor\six.py", line 685, in reraise
        raise value.with_traceback(tb)
      File "c:\users\user1\appdata\local\programs\python\python38-32\lib\site-packages\setuptools\sandbox.py", line 154, in save_modules
        yield saved
      File "c:\users\user1\appdata\local\programs\python\python38-32\lib\site-packages\setuptools\sandbox.py", line 195, in setup_context
        yield
      File "c:\users\user1\appdata\local\programs\python\python38-32\lib\site-packages\setuptools\sandbox.py", line 250, in run_setup
        _execfile(setup_script, ns)
      File "c:\users\user1\appdata\local\programs\python\python38-32\lib\site-packages\setuptools\sandbox.py", line 45, in _execfile
        exec(code, globals, locals)
      File "C:\Users\user1\AppData\Local\Temp\easy_install-uk90cjv2\numpy-1.17.3\setup.py", line 443, in <module>
      File "C:\Users\user1\AppData\Local\Temp\easy_install-uk90cjv2\numpy-1.17.3\setup.py", line 435, in setup_package
      File "C:\Users\user1\AppData\Local\Temp\easy_install-uk90cjv2\numpy-1.17.3\numpy\distutils\core.py", line 171, in setup
      File "c:\users\user1\appdata\local\programs\python\python38-32\lib\site-packages\setuptools\__init__.py", line 145, in setup
        return distutils.core.setup(**attrs)
      File "c:\users\user1\appdata\local\programs\python\python38-32\lib\distutils\core.py", line 163, in setup
        raise SystemExit("error: " + str(msg))
    SystemExit: error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\user1\AppData\Local\Temp\pip-install-mer9iuas\matplotlib\setup.py", line 262, in <module>
        setup(
      File "c:\users\user1\appdata\local\programs\python\python38-32\lib\site-packages\setuptools\__init__.py", line 144, in setup
        _install_setup_requires(attrs)
      File "c:\users\user1\appdata\local\programs\python\python38-32\lib\site-packages\setuptools\__init__.py", line 139, in _install_setup_requires
        dist.fetch_build_eggs(dist.setup_requires)
      File "c:\users\user1\appdata\local\programs\python\python38-32\lib\site-packages\setuptools\dist.py", line 716, in fetch_build_eggs
        resolved_dists = pkg_resources.working_set.resolve(
      File "c:\users\user1\appdata\local\programs\python\python38-32\lib\site-packages\pkg_resources\__init__.py", line 780, in resolve
        dist = best[req.key] = env.best_match(
      File "c:\users\user1\appdata\local\programs\python\python38-32\lib\site-packages\pkg_resources\__init__.py", line 1065, in best_match
        return self.obtain(req, installer)
      File "c:\users\user1\appdata\local\programs\python\python38-32\lib\site-packages\pkg_resources\__init__.py", line 1077, in obtain
        return installer(requirement)
      File "c:\users\user1\appdata\local\programs\python\python38-32\lib\site-packages\setuptools\dist.py", line 786, in fetch_build_egg
        return cmd.easy_install(req)
      File "c:\users\user1\appdata\local\programs\python\python38-32\lib\site-packages\setuptools\command\easy_install.py", line 679, in easy_install
        return self.install_item(spec, dist.location, tmpdir, deps)
      File "c:\users\user1\appdata\local\programs\python\python38-32\lib\site-packages\setuptools\command\easy_install.py", line 705, in install_item
        dists = self.install_eggs(spec, download, tmpdir)
      File "c:\users\user1\appdata\local\programs\python\python38-32\lib\site-packages\setuptools\command\easy_install.py", line 890, in install_eggs
        return self.build_and_install(setup_script, setup_base)
      File "c:\users\user1\appdata\local\programs\python\python38-32\lib\site-packages\setuptools\command\easy_install.py", line 1158, in build_and_install
        self.run_setup(setup_script, setup_base, args)
      File "c:\users\user1\appdata\local\programs\python\python38-32\lib\site-packages\setuptools\command\easy_install.py", line 1146, in run_setup
        raise DistutilsError("Setup script exited with %s" % (v.args[0],))
    distutils.errors.DistutilsError: Setup script exited with error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

__deets__
User
Beiträge: 14542
Registriert: Mittwoch 14. Oktober 2015, 14:29

Der Hinweis bezueglich Python3.8 war allgemeiner Natur. Das ist keine Woche alt. Da sind halt noch nicht alle 3rd-party-Pakete fuer erhaeltlich. Warum bestehst du darauf, Python 3.8 zu benutzen?
10211291
User
Beiträge: 25
Registriert: Montag 8. Juli 2019, 10:51
Wohnort: Berlin

Hm.. ich hatte vorher eine ältere Version, die super funktioniert hatte, bis eines Tages ein Fehler auftrat, das Pakete matplotlib wurde nicht mehr erkannt und ließ sich nicht ohne weiteres über pip installieren. Nach langem hin und her habe ich dann Python neu installiert und bin auf Python 3.9 gestoßen, ohne mir groß Gedanken zu machen.

Habe jetzt zurückgesetzt auf Python 3.7.4 und das kompilieren dort. Vielen Dank!

Jetzt habe ich immer noch das Problem, dass matplotlib nicht erkannt wird. Ich habe pip installiert und den Pfad zu den Umgebungsvariablen hinzugefügt (C:\Program Files\Python37\Scripts).

Bei der Installation erhalte ich folgende Mitteilung:

Code: Alles auswählen

C:\Users\user1\Desktop>python get-pip.py --user
Collecting pip
  Using cached https://files.pythonhosted.org/packages/00/b6/9cfa56b4081ad13874b0c6f96af8ce16cfbc1cb06bedf8e9164ce5551ec1/pip-19.3.1-py2.py3-none-any.whl
Installing collected packages: pip
  Found existing installation: pip 19.3.1
    Uninstalling pip-19.3.1:
      Successfully uninstalled pip-19.3.1
  WARNING: The scripts pip.exe, pip3.7.exe and pip3.exe are installed in 'C:\Users\julange\AppData\Roaming\Python\Python37\Scripts' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed pip-19.3.1
Wenn ich in der Kosole jetzt pip eingebe, erhalte ich folgende Fehlermeldung:

Code: Alles auswählen

 Traceback (most recent call last):
  File "c:\program files\python37\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\program files\python37\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Program Files\Python37\Scripts\pip.exe\__main__.py", line 9, in <module>
TypeError: 'module' object is not callable 
Hat jemand einen Tipp?
PyMy
User
Beiträge: 2
Registriert: Samstag 2. November 2019, 09:31

Sieht entweder nach einem Rechte- oder Pfad-Problem aus. Du scheinst ja mit mehreren Nutzerprofilen und dem Systemverzeichnis zu arbeiten.
PythonManiac
User
Beiträge: 1
Registriert: Dienstag 17. März 2020, 16:34

Hallo,

ich habe das Problem mit den Modulen pyttsx3 bzw. gtts.
(Python 3.7, windows)
Install von gtts mittels pip3 install gtts funktioniert; allerdings erscheint beim Ausführen (Eclipse mit Pydev: import gtts)
-> ModuleNotFoundError: No module named 'gtts'
Gleiches mit dem Modul sklearn.

Kennt sich hier jemand aus?
__deets__
User
Beiträge: 14542
Registriert: Mittwoch 14. Oktober 2015, 14:29

Das wird aller Wahrscheinlichkeit nach das Problem von Eclipse sein. Wenn du in der Kommandozeile im interaktiven Interpreter die Pakete importieren kannst, dann sind die auch installiert. Dann musst du nur noch Eclipse beibringen, das richtige Python zu benutzen. Wie das geht ist bestimmt irgendwo beschrieben, ich benutze das nicht.
Antworten