I am very new to Python installations and trying to install PIL. I have a feeling they are being installed to the wrong directory. PIP seems to have been installed fine.
Pycharm says
Try to run this command from the system terminal. Make sure that you
use the correct version of 'pip' installed for your Python interpreter
located at
'/Library/Frameworks/Python.framework/Versions/3.5/bin/python3.5'.
However when checking in terminal the reply is
Jamess-MacBook-Pro:~ JamesParsons$ pip install Pillow
Requirement already satisfied (use --upgrade to upgrade): Pillow in
/Library/Python/2.7/site-packages
Its also mentions a different version of Python.
How would the best way to install PIL be as Pycharm is coming up with unresolved reference still?
On your command line:
$ which python
I'm betting that this returns:
/Library/Python/2.7/site-packages
This shows your 'basic' Python (which comes preinstalled on Mac) location. Now do:
$ which python3
If that shows this:
/Library/Frameworks/Python.framework/Versions/3.5/bin/python3.5'
Then check for a pip3 version:
$ which pip3
If that exists and has a similar location to python3, then try this:
$ pip3 install Pillow
If that works, there is a good chance PyCharm will now pick up the correct installation.
Related
I was trying to install preview-generator and so I typed pip install preview-generator and I got this: ERROR: Package 'preview-generator' requires a different Python: 2.7.16 not in '>= 3.4' so I tried pip install -U pip and it said that Requirement already up-to-date: pip in ./.local/lib/python2.7/site-packages (20.3.4) so how would I update it?
Edit: I tried pip3 install preview-generator and it worked
My suggestion is: don't mess your system's python installation. There might be other modules that depend on that being what it is. Use pyenv to manage python versions.
Check https://github.com/pyenv/pyenv
Check this post for a detailed explanation: https://realpython.com/intro-to-pyenv/
I am on the latest version of python and I have tried all the commands to install pyjama, but the error I get is:
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: pygame in /Library/Python/2.7/site-packages (1.9.6)
I don't know where to find this information or how to downgrade to a older version of python.
Can anyone help??
could you provide the commands you used for installation which results in that error?
Seems like you've already installed it on Python2 and are trying to install it there again. If you're using pip, maybe you could try using pip3 instead. Alternatively you can also use the following command:
python3 -m pip install XXX
this question is specifically for aws cloud9. Everything looks fine prima-facie, but it's creating a lot of problems.
When i am checking python version, it's showing the correct version (without using python3)
xxxx#yyyyy.zzz:~/environment $ python --version
Python 3.6.8
When i am using which python, it's showing the correct (desired) python version
xxxx#yyyy.zzz:~/environment $ which python
alias python='python36'
/usr/bin/python36
When i am checking pip version, it's showing pip version for python 3.6, but showing a very old version of pip.
xxxx#yyyy.zzz:~/environment $ python -m pip --version
pip 9.0.3 from /usr/lib/python3.6/dist-packages (python 3.6)
When i try to upgrade pip to new version, it goes to python2.7 now (undesirable)
xxx#yyyy.zzz:~/environment $ pip install --upgrade pip
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Defaulting to user installation because normal site-packages is not writeable
Requirement already up-to-date: pip in /usr/local/lib/python2.7/site-packages (20.0.2)
so, when i do a pip install of a desired package, it gets installed, but cannot use it in my program as it installs for python 2.7.
I have gone past this issue on my local windows computer a long time ago. However, this is a ec2 default environment that comes when setting up cloud9, and is a linux ubuntu dist (afaik).
Have tried to find out online, but couldn't get a simple answer. I could find answers relating to using virtualenv for these kind of issues. I am wondering if there is a simpler solution to this.
I finally resolved it by unaliasing "python" with python36.
unalias python
Then when i went to ask python version, it gave python 2.7 (as expected)
then i went for
sudo python3 -m pip install --upgrade pip
it finally worked and upgraded pip to latest.
then i could download other libraries using
python3 -m pip install <library-name>
Thanks Arun for your extensive help.
This solution may be a workaround, but it finally made it work. If anyone wants me to find the solution further, i am ready to engage.
python is an alias to point to python36. Looks like you have python 2 and python 3 installed.
python -m pip --version is returning the pip version pointing to python3 because python here refers to python3. If you try python2.7 -m pip --version it will return the pip version corresponding to python2.7
You should rather check pip --version to see the version of pip.
You could install your packages using pip3 install <package-name> or set an alias for pip to point to pip3
which pip3
Once you get the path of pip3, then you can create the alias
alias pip=`<path to pip3>
I have a brand new installation of python 3.7.1 64-bit and I'm using the latest pyCharm as my IDE. I have no other installation of python on this machine.
I go to install numpy and I get this message:
(venv) C:\Users\John\PycharmProjects\project>pip install numpy
Requirement already satisfied: numpy in c:\users\john\pycharmprojects\pysims\venv\lib\site-packages (1.15.4)
You are using pip version 10.0.1, however version 18.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
So I run the suggested command but it's already up-to-date
(venv) C:\Users\John\PycharmProjects\project>python -m pip install --upgrade pip
Requirement already up-to-date: pip in c:\users\john\pycharmprojects\pysims\venv\lib\site-packages (18.1)
So I check the version but it's still the old version
(venv) C:\Users\John\PycharmProjects\pySIMS>pip -V
pip 10.0.1 from c:\users\john\pycharmprojects\pysims\venv\lib\site-packages\pip-10.0.1-py3.7.egg\pip (python 3.7)
I thought I'd try py -3 to upgrade and it works.
(venv) C:\Users\John\PycharmProjects\pySIMS>py -3 -m pip install --upgrade pip
Collecting pip
Using cached https://files.pythonhosted.org/packages/c2/d7/90f34cb0d83a6c5631cf71dfe64cc1054598c843a92b400e55675cc2ac37/pip-18.1-py2.py3-none-any.whl
Installing collected packages: pip
Found existing installation: pip 10.0.1
Uninstalling pip-10.0.1:
Successfully uninstalled pip-10.0.1
Successfully installed pip-18.1
But the version is still old
(venv) C:\Users\John\PycharmProjects\pySIMS>pip -V
pip 10.0.1 from c:\users\john\pycharmprojects\pysims\venv\lib\site-packages\pip-10.0.1-py3.7.egg\pip (python 3.7)
WHAT IS GOING ON? Am I missing something totally obvious? I've never had an issue like this working in Python 2 but since I've moved to Python 3 it's been nothing but errors.
This is looking like you have multiple installation of pip, one that comes first in the PATH (pip) and another that is recognized by python (python -m pip).
Try running the command:
pip show pip
and
python -m pip show pip
And check if the path are the same.
If not i would suggest uninstalling the undesired one, or change your your PATH environment variable to have the folder containing the correct pip come before the folder with the wrong one.
When I got this error I had 2 pip version folders in site-packages. One pip-19.2.3.dist-info and another something like pip-10.0.1. I deleted the first one, leaving only the default version. Then running python -m pip install --upgrade pip fixed the problem
I had a similar issue where I was upgrading pip; however, my issue what that I had a pip.conf file that pointed to a repo that didn't have the version to upgrade to. I removed the pip.conf to allow it to go to the default repo and it was able to download the correct version and upgrade.
1.Open you project setting(File>Settings)
2.Project>Project Interpreter
3.find pip and lick the triangle on the right(in the red circle I draw)
In last project, I used python 2.7. The new one have to run in python 3.5 so I installed 3.5. I choose Python 3.5 in Setting-->Python interpreter, and I got Error : Django is not importable in this environment.
Then I tried to run
pip install django
Requirement already satisfied (use --upgrade to upgrade): django in c:\python27\lib\site-packages
Cleaning up...
It seems that something wrong with the path, and how could I make it right?
It's probably because the pip command points to python2.7 version of pip, and as django is already installed for python 2.7, you are getting the message you mentioned.
You need to install django for python3.5. To do that, either directly run pip executable inside python3.5 folder, or choose python3.5 as the interpreter from pycharm, and install django through the ui of pycharm.
Depending on how you installed python3.5, you could also run
pip3.5 install django
from the console to invoke python3.5 version of pip
Just go with pip3 suited for Python 3x envs:
pip3 install Django