Seite 1 von 1

Module installiert aber nicht importierbar

Verfasst: Donnerstag 9. Januar 2020, 23:04
von Martin.3112
Hallo Leute,

ich hab jetzt schon seit einiger Zeit das Problem, dass die Module zwar installiert sind (z.B. über Pycharm direkt oder übers Terminal), ich die Module aber nicht importieren kann, bzw. dort Fehlermeldungen auftreten (siehe Link -> Screenshot)
Hab schon tausende Videos dazu gesehen aber komme einfach nicht weiter.
Wäre super, wenn mir jemand helfen könnte!
Vielen Dank

https://www.bilder-upload.eu/bild-1f840 ... 3.png.html

Re: Module installiert aber nicht importierbar

Verfasst: Freitag 10. Januar 2020, 06:14
von __deets__
Üblicherweise falscher Interpreter. Was sagen

import sys
print(sys.executable)

jeweils in pycharm und im Terminal wo du zb pip laufen lässt?

Re: Module installiert aber nicht importierbar

Verfasst: Freitag 10. Januar 2020, 22:05
von Martin.3112
Vielen Dank dir schonmal. Hab jetzt die Grundlagen für Python gelernt und hätte mega Bock mit neuen Modulen zu starten
Pycharm:
/Users/"meinName"/PycharmProjects/First/venv/bin/python /Users/"meinName"/PycharmProjects/First/Graphen.py
/Users/"meinName"/PycharmProjects/First/venv/bin/python

Process finished with exit code 0

terminal:
>>> import sys
>>>
>>> print(sys.executable)
/Users/“SanktMartin”/PycharmProjects/First/venv/bin/python
>>>

Re: Module installiert aber nicht importierbar

Verfasst: Freitag 10. Januar 2020, 22:43
von Martin.3112
Kann vll ein Mod hier unten in der vorletzten zeile den namen zensieren? ;) danke

Re: Module installiert aber nicht importierbar

Verfasst: Dienstag 14. Januar 2020, 21:48
von Billi
Einen guten Abend wünsche ich.
Ich habe ein ähnliches Problem mit NumPy. Ich nutze Thonny und bei der Eingabe bekomme ich den Fehler (siehe unten).
Im packagemanager ist numpy enthalten und wenn ich es neu installieren will sagt er mir das die aktuellste Version installiert ist. Ich habe schon alles mir Mögliche versucht, bin jetzt völlig ratlos und hoffe auf eure Hilfe. (Ich hatte matplotlib mit pip installiert, das war das gleiche Problem.)

Python 3.5.3 (/usr/bin/python3)
>>> import numpy as np
Traceback (most recent call last):
File "/home/pi/.local/lib/python3.5/site-packages/numpy/core/__init__.py", line 24, in <module>
from . import multiarray
File "/home/pi/.local/lib/python3.5/site-packages/numpy/core/multiarray.py", line 14, in <module>
from . import overrides
File "/home/pi/.local/lib/python3.5/site-packages/numpy/core/overrides.py", line 7, in <module>
from numpy.core._multiarray_umath import (
ImportError: libf77blas.so.3: cannot open shared object file: No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "<pyshell>", line 1, in <module>
File "/home/pi/.local/lib/python3.5/site-packages/numpy/__init__.py", line 142, in <module>
from . import core
File "/home/pi/.local/lib/python3.5/site-packages/numpy/core/__init__.py", line 54, in <module>
raise ImportError(msg)
ImportError:

IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!

Importing the numpy c-extensions failed.
- Try uninstalling and reinstalling numpy.
- If you have already done that, then:
1. Check that you expected to use Python3.5 from "/usr/bin/python3",
and that you have no directories in your PATH or PYTHONPATH that can
interfere with the Python and numpy version "1.18.1" you're trying to use.
2. If (1) looks fine, you can open a new issue at
https://github.com/numpy/numpy/issues. Please include details on:
- how you installed Python
- how you installed numpy
- your operating system
- whether or not you have multiple versions of Python installed
- if you built from source, your compiler versions and ideally a build log

- If you're working with a numpy git repository, try `git clean -xdf`
(removes all files not under version control) and rebuild numpy.

Note: this error has many possible causes, so please don't comment on
an existing issue about this - open a new one instead.

Original error was: libf77blas.so.3: cannot open shared object file: No such file or directory

Re: Module installiert aber nicht importierbar

Verfasst: Mittwoch 15. Januar 2020, 21:01
von Fire Spike
Probier mal das:

Code: Alles auswählen

sudo apt install libatlas-base-dev
:wink:

Lösung kam von hier