Cannot import zmq in python using pycharm - python

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

Related

Cannot use the package "openexr" in python within Blender

I've installed the "openexr" package within my windows system. To do this, i used powershell from my blender installation folder "C:\Program Files\Blender Foundation\Blender 3.0\3.0\python" to launch the command ".\bin\python.exe -m ensurepip", for installing pip, and then "pip install openexer" to install the package.
Everything seems fine, but when I open blender and start to code with a simple
import openexr
I obtain this error:
Traceback (most recent call last):
File "\Text", line 1, in <module>
ModuleNotFoundError: No module named 'openexr'
Error: Python script failed, check the message in the system console
The module seems installed, but it's like blender cannot access it. Someone can help me? I would be extremely happy if this could work !
At the moment I tried to re-install pip or the openexr package, but the problem persist.
Also, if I try to re-install openexr, the system answer me that the package is already installed.

Not being able to run my python scripts that contain third-party modules using Win+R command

I am trying to run my code using Win+R.
I am able to run a python script without using third-party modules. But when I use some third-party module in my code it shows this error:
Traceback (most recent call last):
File "C:\Users\pkgar\Desktop\Newfolder\pw.py", line 6, in <module>
import sys,pyperclip
ModuleNotFoundError: No module named 'pyperclip'
Edit: I am able to run the code in VS code, but I am just curious how to run the code using Win+R command.It is running perfectly using Win+R command when I don't use pyperclip module at all.
you haven't installed pyperclip yet.
you can install it using pip install pyperclip on your cmd.
check this out
https://pypi.org/project/pyperclip/
and olso if pip itself hasn't installed yet use
https://pip.pypa.io/en/stable/installing/

ModuleNotFoundError: No module named 'cryptography'

these are the Error messages I am geeting on running any of my project modules.
Traceback (most recent call last):
File "C:\Users\hsnl\BlockchainCodesTutor\Wallet.py", line 3, in <module>
import Transactions
File "C:\Users\hsnl\BlockchainCodesTutor\Transactions.py", line 2, in <module>
import Signatures
File "C:\Users\hsnl\BlockchainCodesTutor\Signatures.py", line 2, in <module>
import cryptography
ModuleNotFoundError: No module named 'cryptography'
I have already installed the cryptography module and was working perfectly until today I start getting this message that " No module named 'cryptography'".
I have again installed the cryptography as well as pip package but still showing the same error.
There might be loose versions running on your system. Please try the following:
python -m pip uninstall cryptography
python -m pip install cryptography
You can also check out this with python -m to make sure you are not using a loose pip.
You might not have cryptogtaphy installed correctly. I see you are using windows. Open commandline as an administrator and run pip install cryptography again. Enshure that the installation finishes without any errors and consider to restart your python interpreter after installation.
For further help you should post more details like the output of pip and your code leading to the error, so a more detailed answer for your problem can be given.
Try download cryptography whl from here.
Then use pip install cryptography-XXX.whl
For example:
pip install cryptography-3.3.1-cp36-abi3-win_amd64.whl
And now just supports python2.7 and python3.6.

How to install packages in Anaconda environment in VScode?

I am running my code in VScode, my python interpreter being Anconda3\python.exe . When running the following code : -
from Ipython import display
I encounter the following error in the python terminal :
PS C:\Users\Clover\Desktop\Speech Recognition> C:/ProgramData/Anaconda3/python.exe "c:/Users/Clover/Desktop/Speech Recognition/ml_code_first.py"
Traceback (most recent call last):
File "c:/Users/Clover/Desktop/Speech Recognition/ml_code_first.py", line 11, in <module>
from Ipython import display
ModuleNotFoundError: No module named 'Ipython'
I've tried to install it on the conda terminal using :
pip install ipython
and it shows that requirement already satisfied which means the package is installed but why is this package not detected in VScode?
At least there is the warning from the conda developers: Never mix conda-forge installs and pip installs. This might help.

Modules are not recognized after install

I have downloaded selenium module and installed it using python setup.py install. When i open up Pycharm and try to import Selenium it gives me this error:
Traceback (most recent call last):
File "C:/Users/mali03/.PyCharmCE2018.1/config/scratches/exe.py", line 1, in
<module> from selenium import webdriver
ModuleNotFoundError: No module named selenium'
Is it because of the interpreter? Where did python install the module and how do i access it?
It's because of Pycharm doesn't know where to find out selenium, or which python interpreter you are using.
Please select correct Python version.
You can found them in Settings | Project Interpreter > Wheel - More > Show Paths for the selected interpreter"

Categories