I have installed python 3.7.0 and my installation directory is AppData\Local\Programs\Python\Python37-32
Now I have tried to upgrade pip with:
python -m pip install –upgrade pip'
and I got:
Successfully installed pip-19.0.3
I did pip install ijson(while I was in folder AppData\Local\Programs\Python\Python37-32\Scripts) and double checked with the result being:
Requirement already satisfied: ijson in c:\users\myusername\appdata\local\programs\python\python37-32\lib\site-packages (2.3)
But when I go to my PyCharm project and I import ijson it can't find the module.Just to be clear if I import json or any other module I can work with it.
I know this has some duplicates and I have seen some of them. I have tried everything for example on these and others. Just for reference (possible duplicate)(possible dublicate 2)
but I haven't been able to solve my issue. Please tell me if I am missing something, maybe it is connected to the interpreter I am using or a wrong installion of python.
Thank you in advance
Make sure the python interpreter you are using in Pycharm is the one where you install ijson via pip.
You can do this by looking at the interpreter path in PyCharm, then opening that path in your terminal and trying import ijson
Also make sure the pip you are using is connected to the python interpreter you are using in PyCharm
Related
I'm trying to run this : https://github.com/HansiMcKlaus/AudioSpectrumVisualizer
And so I followed needed to be done to run it.
I pip install all the requirements, ffmpeg and try to run with the default example.
% python AudioSpectrumVisualizer.py 'sample.mp3'
And I have the error message :
ImportError: No module named joblib
Which is weird, because I already installed joblib.
So I tried some stuff,
tried to install it again :
% pip3 install joblib
Requirement already satisfied: joblib in /usr/local/lib/python3.10/site-packages (1.0.0)
tried to export the PythonPath in the bash and zsh profile files.
export PYTHONPATH="/usr/local/lib/python3.9/site-packages"
Nothing works.
I'm on Mac M1 and I never had any issue installing modules with python before.
Thanks for the help
you might have multiple installations of python itself, causing your program and command line to refer to the different versions.
An example to fix this would be to uninstall the old versions of python
run it with the sudo code, this might help!
I'm new to python, about a month.
I know installing python modules can be done by using pip or easy_install. But when I was trying to install the regex module it gave me an error.
Typing pip install re in cmd gave me the following errors;
ERROR: Could not find a version that satisfies the requirement re (from versions: none)
ERROR: No matching distribution found for re
So I went to PyPI and downloaded a file there and now PyCharm doesn't give error when I import the module anymore.
So are there any difference between these ways of downloading Python modules or it doesn't matter ?
I'm using Windows 10 and have Python 3.8 and 3.8.1.
re is a built-in module, therefore you are not required to install this with pip.
Python Built-In Modules
re is part of the Python standard library so there is no need to install it separately. There are many ways to 'install' a package, e.g. using easy_install, pipx, venv, poetry, etc., but pip install --user is likely the way you're going to want to go to get started until you run into a compelling reason to explore other options. Either way, all these tools are essentially just various ways to move packages into PYTHONPATH, the place that Python looks for packages by default.
I am completely new to Python and and still in my babysteps at coding and can't get this thing to work.
I am trying to build an auto-clicker as a learning experience, so I use pynput:
from pynput.mouse import Button, Controller
from pynput.keyboard import Listener, KeyCode
But I get the error:
from pynput.mouse import Button, Controller
ModuleNotFoundError: No module named 'pynput'
As troubleshooting I again typed in the cmd "pip install pynput" and got:
Requirement already satisfied: pynput in c:\program files (x86)\python\python37-32\lib\site-packages (1.4)
Requirement already satisfied: six in c:\program files (x86)\python\python37-32\lib\site-packages (from pynput) (1.12.0)
Just to be sure, I also tried "pip3 install pynput" with the same result. When I am in the IDLE and type in "import pynput", I get no errors. I only have one python version installed.
Do you have any ideas what I am still doing wrong?
If you need any more information, just let me know.
Thank you in advance.
JM
You should check the Interpreter the PyCharm uses for your project here:
File -> Settings -> Project: %Project_name% -> Project Interpreter.
It should be same as where you installed pynput.
There might be one of these possibilities to this problem:
The package was not correctly installed. Uninstall it and install it again and see if issue persists.
There could be permission issue on the path where the package is installed. Does it have full rw permissions so python can access it? If you are using linux, use "sudo pip install"
If you have installed the package inside a virtualenv and running the program outside the virtualenv, the package will not be available.
I had a same problem with pynput module.
I fixed my problem in the below.
I checked my python file name and it was a "pynput.py"
This may call my file as pynput module.
So, I changed my file name "pynput.py" --> "pynput1.py"
And, it works well!!
I really hope it can resolve your problem
You probably have multiple python installations and the one used by pycharm is not the one linked with the pip binary.
To solve this issue is it enough to install the library using pip as a module.
Step 1: understand what python interpreter you are actually using
import sys
print(sys.executable)
the output is your path_interpreter (something like /Users/xyz/bin/python)
Sept 2: run pip with that interpreter
from terminal: path_interpreter -m pip install pynput
That's it.
UPDATE: if you get failed to acquire X connection: No module named 'tkinter', try sudo apt-get install python3-tk
If your using PyCharm, try going to the terminal shell (that's built in PyCharm), and type pip install pynput.
If you are using any different IDE, go to your device terminal and type the same thing.
I've tried installing xlsxwriter on MacOS
I tried:
pip install xlsxwriter
easy_install xlsxwriter
python -m easy_install xlsxwriter
python -m pip install xlsxwriter
with
pip uninstall xlsxwriter
in between each attempt.
I've tried all different versions of Python and Psychopy, and for the life of me, I can't get rid of this error when I try to run Psychopy:
"No module named xlsxwriter"
I know it's installed because I can search for it (it says it's located in
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/XlsxWriter-1.0.0-py2.7.egg)
I've tried moving it and copying it to all different levels of my Python folder in "Applications" as well as putting it in the same folder as my .py file I'm trying to run in Psychopy, and I just can't get it to work.
I've tried updating xlsxwriter (it's currently 1.0).
I've tried case-sensitive (XlsxWriter vs. xlswriter).
I've read the forums on this but none of the suggestions have helped so far. I don't know what else to do.
This actually worked great for me:
Make sure/or change directory of your windows python 27 or python 33 is C:\Python27
Download XlsxWriter package ( https://pypi.python.org/pypi/XlsxWriter )
Extrat tar file (lookup for tar extractor tool for windows)
Open cmd
Go to your downlaoded and extracted package directory
Type in command prompt: python setup.py install
You can now check module intalled in C:\Python27\Lib\site-packages
did you tried pip3 install xlsxwriter. worked for me.
I am trying to write a basic keylogging program on python. I need to install the pywin32 and pyhook modules. I have managed to get pywin32 installed, but cannot seem to pyhook to work. I have read its possible to get it to work on later versions of python, but cannot seem to figure it out. I have tried both .exe and .whl installs. Using whl in cmd gives error that the wheel is not supported. Does anyone have a solution to install pyhook on python 3.5. Thanks
This is how I did it...
Download the py hook module that matches your version of python from here. Make sure that if you have python 32 bit you download the 32 bit module (even if you have windows 64x) and vice versa.
Open your command prompt and navigate to the folder where you downloaded the module
Type "pip install " and then the name of the file.
Ex: "pip install pyHook-1.5.1-cp27-none-win32.whl"
Note : you need pip
If your pip install have not success.
Try -> when you download a pyHook-1.5.1-cp27-none-win32.whl file from http://www.lfd.uci.edu/~gohlke/pythonlibs/#pyhook
After that move file to Programs\Python\Python35-32\Scripts path
and then pip install pyHook-1.5.1-cp27-none-win32.whl
I hope my answer is useful for you.