I'm trying to run a script that is using "cryptography" module but when i run it says
No module named cryptography:
Traceback (most recent call last):
File "....\Desktop\script.py", line 12, in <module>
from cryptography import x509
ImportError: No module named cryptography
The module is correctly installed:
Package Version
cryptography 3.4.8
I'm using:
python 3.9
windows 10
*pip 21.2.4 from c:\program files\python39\lib\site-packages\pip (python 3.9)
Already tried to uninstall and install the module, already updated pip.
Any advice ?
Related
I'm on Windows using PowerShell and I'm trying to run a python script that calls another script that imports msgpack. My msgpack version is 1.0.2.
> python3 .\testing.py
Traceback (most recent call last):
File "C:\<path>\testing.py", line 1, in <module>
import b0RemoteApi
File "C:\<path>\b0RemoteApi.py", line 7, in <module>
import msgpack
ModuleNotFoundError: No module named 'msgpack'
I solved the issue. For anyone else who had this problem, I had two versions of Python installed, 3.8 and 3.9. msgpack was installed in the 3.8 directory and PowerShell was using Python 3.9, so I uninstalled the older version and reinstalled msgpack.
I am trying to install multipart and simply running the command
pip install multipart
But I am getting and error
Complete output (7 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/cn/h4g68yd17jq5fx0cqf0fss180000gn/T/pip-install-w_zyum/multipart/setup.py", line 7, in <module>
from multipart import __version__, __author__, __license__, __doc__
File "multipart.py", line 22, in <module>
from urllib.parse import parse_qs
ImportError: No module named parse
I have checked Python and PIP versions. I have Python 2.7 and 3.7 installed on the system. Doing -
pip3 install multipart
Returns -
Requirement already satisfied: multipart in /usr/local/lib/python3.7/site-packages (0.2)
Edit - It is for a legacy work project which is in Python 2.7 and can't be updated to 3x for now.
multipart 0.2 is available for python 3 only.
for python 2.7 you can install multipart version 0.1 by
pip install multipart==0.1
I am trying to import a module that I know for a fact that was installed, but I am getting the ModuleNotFoundError: No module named '' error.
How can I solve this problem ?
HelendeMacBook-Pro:bin helendai$ pip3 list
Package Version
---------- ----------
certifi 2019.11.28
chardet 3.0.4
idna 2.9
pip 20.0.2
requests 2.23.0
setuptools 39.0.1
urllib3 1.25.8
wheel 0.31.0
HelendeMacBook-Pro:bin helendai$ python3 /Users/helendai/PycharmProjects/Demo1/test.py
Traceback (most recent call last):
File "/Users/helendai/PycharmProjects/Demo1/test.py", line 2, in <module>
import requests
ModuleNotFoundError: No module named 'requests'
enter image description here
I have to run a python 3 script on a centos 7 host. I've installed python3.8 side by side with python2 so it doesn't break yum.
When I'm running the script I need to run I get this error:
Traceback (most recent call last):
File "A2PTestSuit.py", line 8, in <module>
import pandas as pd
File "/usr/local/lib/python3.8/site-packages/pandas/__init__.py", line 16, in <module>
raise ImportError(
ImportError: Unable to import required dependencies:
numpy: No module named '_ctypes'
If I list the modules I see that pandas and numpy are installed:
python3 -m pip list
Package Version
--------------- ----------
certifi 2019.11.28
chardet 3.0.4
DateTime 4.3
idna 2.8
numpy 1.18.1
pandas 0.25.3
pip 19.3.1
python-dateutil 2.8.1
pytz 2019.3
requests 2.22.0
setuptools 41.2.0
six 1.13.0
urllib3 1.25.7
zope.interface 4.7.1
How can I get past this error?
You can try updating all of your packages in the command line using pip, or just use try: import ... except ImportError: continue
I've got same issue. Problem was solved after I change default interpreter (which was Python 3.8) in PyCharm
Have installed pip3 via sudo apt-get. But while trying to check the pip3 --version, its throwing
ImportError: No module named 'pip._vendor.requests'
How do i fix this?
server -- Linux Debian 4.9.65-3,
Python version -- Python 3.5.3
p.s. have tried uninstalling and reinstalling pip3 but no luck.
Full stack trace:-
Traceback (most recent call last): File "/usr/bin/pip3", line 9, in
from pip import main File "/usr/lib/python3/dist-packages/pip/init.py", line 21, in
from pip._vendor.requests.packages.urllib3.exceptions import DependencyWarning ImportError: No module named 'pip._vendor.requests'