I'm trying to install pyperclip on Python 3.8.6 on Windows 10, and after typing
pip3 install pyperclip
in cmd it tells me that pyperclip has been successfully installed, but when I then try import pyperclip on they Python shell I get the following error message:
Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
import pyperclip
ModuleNotFoundError: No module named 'pyperclip'
I've tried uninstalling and reinstalling pyperclip using pip, and also installing an older version of the package (1.8.0) but the error persists.
Thanks for your help!
Related
I'm facing this issue whenever I am installing and importing gTTS.
Issue in installing:
ERROR: Could not install packages due to an OSError: [WinError 2] The system cannot find the file specified: 'C:\\Python310\\Scripts\\gtts-cli.exe' -> 'C:\\Python310\\Scripts\\gtts-cli.exe.deleteme'
Issue in importing:
Traceback (most recent call last):
File "C:/Users/User/Desktop/check.py", line 1, in <module>
from gtts import gTTS
ModuleNotFoundError: No module named 'gtts'
I did pip install gtts
and imported from gtts import gTTS.
Thank you!
PS: Python version : 3.10.0
How to install gTTS in Python.
There can be problems caused in installation and usage because of Admin access. The solution is to install gTTS using :
pip install -U gtts
Reference: https://github.com/pypa/pip/issues/9023#issuecomment-713171229
A similar report was posted, but the suggested solutions do not work.
---- from Jupyter ----
Import psycopg2
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-2-7d2da0a5d979> in <module>
----> 1 import psycopg2
ModuleNotFoundError: No module named 'psycopg2'
If I run python3 from Mac terminal and then import psycopg2 that works.
If I run python3 from Jupyterlab terminal this does not work. I get the following error after running import pyscopg2
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/psycopg2/__init__.py", line 50, in <module>
from psycopg2._psycopg import ( # noqa
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/psycopg2/_psycopg.cpython-38-darwin.so, 2): Library not loaded: #rpath/libssl.1.1.dylib
Referenced from: /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/psycopg2/_psycopg.cpython-38-darwin.so
Reason: image not found
echo $PATH from Mac terminal is
/Users/greg/opt/miniconda3/bin:/Users/greg/opt/anaconda3/condabin:/Library/Frameworks/Python.framework/Versions/3.8/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
echo $PATH from Jupyterlab terminal is
/Library/Frameworks/Python.framework/Versions/3.8/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/greg/opt/miniconda3/bin:/Users/greg/opt/anaconda3/condabin
These look the same, just in a different order.
I have tried pip install psycopg2 both with and without the binary option.Either way, it says already satisfied.
I have tried
conda install -c anaconda psycopg2
Also tried installing postgresql both from the postgresql.org, and brew install psycopg2. Both worked, but no luck with Jupyterlab.
try installing the package using: pip install psycopg2-binary. This should work.
For more information, visit: https://www.psycopg.org/docs/install.html
I am trying to use the zmq Python library but it is not recognized and I have already installed it by using the following command:
pip3 install pyzmq
I am using PyCharm IDE.
The run output gives me this error:
Traceback (most recent call last):
File "C:/Users/Operações/Desktop/Testes/teste.py", line 2, in <module>
import zmq
ModuleNotFoundError: No module named 'zmq'
Does anyone can help me with this?
Instead of using pip, try installing pyzmq from File/Settings in PyCharm.
Open the Settings/Preferences
Navigate to Project: -> Python Interpreter
Klick the + at the bottom of the list
Search for your package of choice and hit Install Package
For more details on installing/uninstalling packages in PyCharm:
https://www.jetbrains.com/help/pycharm/installing-uninstalling-and-upgrading-packages.html
Recently, when I use pip to install python modules, I will get an error saying that the module has not been downloaded when I run it in the IDLE. However, when I run the same script in the terminal, it works fine. What is this error and how can I solve it?
Traceback (most recent call last):
File "<pyshell#8>", line 1, in <module>
import gspread
ModuleNotFoundError: No module named 'gspread'
Probably you have different versions of python installed.
The version you used pip to install new modules is different from the version you access with IDLE.
I have installed the openpyxl Python module in my machine, or at least I thought I've done that. I entered these commands on the command prompt (on Windows):
C:\Users\gluti>cd C:\Users\gluti\PycharmProjects\Data Structures\venv\Scripts
C:\Users\gluti\PycharmProjects\Data Structures\venv\Scripts>pip install openpyxl==2.1.4
And then, it shows a message, saying that the module openpyxl was successfully installed. However, when I try to import this module on Python IDLE, it shows the following error message:
import openpyxl
Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
import openpyxl
ModuleNotFoundError: No module named 'openpyxl'
Did I miss something or am I installing the module in the wrong directory?
It is possible you have installed python 2 and python 3 so there are two different versions of pip on your machine.
You need to ensure you are installing openpyxl in the same type of python that you are using to run the script.