Win10, x64, Anaconda Python 3.7
I have recently 'upgraded' to Python 3.7 so some of my modules are missing, for example I am trying to use pyfile by using import plyfile but I get following error,
ModuleNotFoundError: No module named 'plyfile'
Ok simple fix I'll pip install plyfile
(base) PS C:\WINDOWS\system32> pip install plyfile
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
Requirement already satisfied: plyfile in c:\programdata\anaconda2\lib\site-packages (0.5)
Requirement already satisfied: numpy>=1.8 in c:\programdata\anaconda2\lib\site-packages (from plyfile) (1.16.3)
Ahh OK its not installed for py3.7 I'll pip3 install plyfile
(base) PS C:\WINDOWS\system32> pip3 install plyfile
Fatal error in launcher: Unable to create process using '"'
errrr ok pip3 --version
(base) PS C:\WINDOWS\system32> pip3 --version
Fatal error in launcher: Unable to create process using '"'
So I had a look around SO for previous posts & there are a few & honestly after reading them I dont get what's going on.
So whats going on? Am I right to use pip3 & its just badly installed or is there something deeper about the differences between the pips I'm not getting?
Edit 1: pip install --upgrade pip makes no difference
Edit 2:
(base) PS C:\WINDOWS\system32> python --version
Python 3.7.3
(base) PS C:\WINDOWS\system32> pip --version
pip 19.1.1 from c:\programdata\anaconda2\lib\site-packages\pip (python 2.7)
Edit 3:
(base) PS C:\WINDOWS\system32> python -m pip install -U pip
D:\ProgramData\Anaconda3\python.exe: No module named pip
Solution:
Downloaded get-pip.py
Then from the terminal python get-pip.py --ignore-installed
Successful installation & upgrade,
(base) PS D:\Downloads> pip --version
pip 19.1.1 from d:\programdata\anaconda3\lib\site-packages\pip (python 3.7)
pip install plyfile collected & installed plyfile & now import plyfile works
Solution from pip's git page issue #1892 How do you remove pip from a pc if you installed by "get-pip.py"
Related
I am getting following error when using pip command in Windows 10 VIA cmd:
$ pip install numpy
Segmentation fault
where python
C:\Python27\python.exe
where pip
C:\Python27\Scripts\pip.exe
python --version
Python 2.7.10
python -m pip --version
pip 7.0.1 from C:\Python27\lib\site-packages (python 2.7)
Please help.
I tried reisntalling the Python. But it did not work.
But now i cannot uninstall Python giving error :
"There is a problem with this Windows Installer Pacakge..........."
In a virtual environment I get the error
path/to/python: Error while finding module specification for 'pip' (AttributeError: module '__main__' has no attribute '__file__')
when I run commands like
python -m pip install --upgrade pip
python -m pip freeze
However, when I run the same command with pip it works, e.g.
pip install --upgrade pip
pip freeze
python is the same as python3, version is 3.8.12, I reinstalled pip using
pip install --force-reinstall pip
pip version is 21.3.1.
What else can I do so the python -m pip commands work again?
Well, the problem is that a version 60.3.0 is being used, which has a bug. But you cannot install a different version of setuptools, because you have already installed version 60.3.0.
Solution: Wait for version >60.3.0
On 7 Jan 2022 Version 60.3.1 has been released, which fixed the problem in the question.
I wanted to download the PIL library to crop images on python, but I just can't download the module. Here's what appears on the terminal
$ pip install PIL
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
ERROR: Could not find a version that satisfies the requirement PIL (from versions: none)
ERROR: No matching distribution found for PIL
Then I tried this out. But another error shows up
$ python3 -m pip install PIL
Could not find a version that satisfies the requirement PIL (from versions: )
No matching distribution found for PIL
You are using pip version 10.0.1, however version 20.0.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
So I tried to upgrade my pip. But then this shows up
$ pip install --upgrade pip
Defaulting to user installation because normal site-packages is not writeable
Requirement already up-to-date: pip in /Library/Python/2.7/site-packages/pip-20.0.2-py2.7.egg (20.0.2)
When I check my pip version it shows this
$ pip --version
pip 20.0.2 from /Library/Python/2.7/site-packages/pip-20.0.2-py2.7.egg/pip (python 2.7)
When I check my python version it shows this
$ python --version
Python 2.7.10
$ python3 --version
Python 3.7.1
So I downloaded pip3 and then tried the command
$ pip3 install PIL
WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip.
Please see https://github.com/pypa/pip/issues/5599 for advice on fixing the underlying issue.
To avoid this problem you can invoke Python with '-m pip' instead of running pip directly.
Defaulting to user installation because normal site-packages is not writeable
ERROR: Could not find a version that satisfies the requirement PIL (from versions: none)
ERROR: No matching distribution found for PIL
I also tried what they said.
$ python3 -m pip3 install PIL
/Library/Frameworks/Python.framework/Versions/3.7/bin/python3: No module named pip3
Here are some details about my pip and python
$ which pip3
/Library/Frameworks/Python.framework/Versions/3.7/bin/pip3
$ which python3
/Library/Frameworks/Python.framework/Versions/3.7/bin/python3
How do I solve this once and for all?
Because python 2 is no longer supported,
Pip2(invoked by either pip or python -m pip) is complaining that you should use python 3. The package manager for python 3 is called pip3(invoked by pip3 or python3 -m pip).
Your pip3 is currently the latest version and you dont need to take any action to upgrade pip3.
If you want to use PIL in python then i recommend you install pillow. Pillow is the PIL of python 3.
You should be able to install pillow with pip3 install Pillow. Pillow supercedes PIL. (unless you specifically want to use PIL with python 2)
Perhaps you want to configure your terminal to alias pip to pip3 so you wont call pip2 by mistake.
I have recently configured python3 for other application and running on the same machine where python 2.7 was running.. I see python3 applications are working fine with command
python -m pip install package-name and
python3 manage.py runserver command
But I am facing trouble with my existing application and new application with following issue while installing package
You are using pip version 7.1.0, however version 9.0.3 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Collecting django-allauth==0.27.0
Could not find a version that satisfies the requirement django-allauth==0.27.0 (from versions: )
No matching distribution found for django-allauth==0.27.0
This is the command I used,
pip install django-allauth==0.27.0
Anybody know how to resolve it?
This is the command output,
pip 7.1.0 from /Users/overflow/.virtualenvs/ion/lib/python2.7/site-packages (python 2.7)
Try installing another version:
pip install django-allauth
Make sure you're using the version of pip that corresponds to the version of Python you are using:
pip --version
Alternatively, be explicit in which version you use:
python3 -m pip install django-allauth
or
python2 -m pip install django-allauth
try
pip install --upgrade pip
first
and then
pip install django-allauth==0.27.0
I'm little confused with you'r version problem, but you can choose you'r python vertion using py-2.x or py -3.x. For example:
py -3.6 -m pip install djangp-allauth==0.27.0
py -2.7 -m pip install djangp-allauth==0.27.0
I fixed it by uninstalling PIP in each project and then reinstalling it.. Might not be a good solutions, but this works.
Im trying to install python through brew with:
brew install python
But get the following error:
Stevens-MacBook-Pro :: ~ ‹master*› » brew install python
==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/python-2.7.
Already downloaded: /Library/Caches/Homebrew/python-2.7.8_2.mountain_lion.bottle.tar.gz
==> Pouring python-2.7.8_2.mountain_lion.bottle.tar.gz
==> Caveats
Setuptools and Pip have been installed. To update them
pip install --upgrade setuptools
pip install --upgrade pip
You can install Python packages with
pip install <package>
They will install into the site-package directory
/usr/local/lib/python2.7/site-packages
See: https://github.com/Homebrew/homebrew/wiki/Homebrew-and-Python
.app bundles were installed.
Run `brew linkapps` to symlink these to /Applications.
/usr/bin/install_name_tool: object: /usr/local/Cellar/python/2.7.8_2/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python malformed object (unknown load command 10)
Error: Failed to fix install names
The formula built, but you may encounter issues using it or linking other
formula against it.
==> /usr/local/Cellar/python/2.7.8_2/bin/python -ssetup.py --no-user-cfg instal
using one of the approaches described here:
Please make the appropriate changes for your system and try again.
Warning: The post-install step did not complete successfully
You can try again using `brew postinstall python`
==> Summary
🍺 /usr/local/Cellar/python/2.7.8_2: 4626 files, 73M
The error messages says the post install fails, and to try installing it again with:
brew postinstall python
but the error still persists. I also tried brew linkapps and it success fully links python but when I run pip from the console I get this error:
Stevens-MacBook-Pro :: ~ ‹master*› » pip
zsh: /usr/local/bin/pip: bad interpreter: ##HOMEBREW_PREFIX##/opt/python/bin/python2.7: no such file or directory
Any idea what might be going wrong?
Pyenv is a python version management tool, something like rbenv but for python.
You could easily install and change python version via pyenv easily.
The following shows how to install python with version 2.7.8 through pyenv:
ubuntu#ubuntu:~$ pyenv install 2.7.8
Downloading Python-2.7.8.tgz...
-> http://yyuu.github.io/pythons/74d70b914da4487aa1d97222b29e9554d042f825f26cb2b93abd20fdda56b557
Installing Python-2.7.8...
Installing setuptools from https://bootstrap.pypa.io/ez_setup.py...
Installing pip from https://bootstrap.pypa.io/get-pip.py...
Installed Python-2.7.8 to /home/ubuntu/.pyenv/versions/2.7.8
as you can see, its very simple.
The command pyenv install "version" help you to install a specific versions of python easily and even pip, setuptools are also automatically installed.
I suggest giving pyenv a try!!