I am trying to setup Python 3 on my mac computer and I seem to have many versions of pip on my computer, not sure which I should be using.
When I run pip --version in the terminal I get pip 19.2.3 from /Library/Python/2.7/site-packages/pip-19.2.3-py2.7.egg/pip (python 2.7) which I am fairly certain is just the version that comes with mac os.
When I run python3 -m pip --version I get pip 20.1.1 from /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip (python 3.7)
When I run pip3 --version I then get pip 19.0.3 from /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/site-packages/pip (python 3.7)
I was hoping somebody could explain the differences between
The first and third pips seem to be from the OS (assuming you're on Catalina?) and the second one seems to be the one you've installed.
See
https://docs.python.org/3/using/mac.html
and
Python 3.7.3 Inadvertently Installed on Mac OS 10.15.1 - Included in Xcode Developer Tools 11.2 Now?
The quick and nasty answer is each installation of python can have its own pip, which in turn will have a different pipenv. This is all based off of your path. Most people opt to use virtualenv to create an app specific python environment so as to not impact other python applications which depend on specific conflicting versions.
Related
I have two versions of python3 installed on my computer. They are located here:
/usr/local/bin/python3
/usr/bin/python3
I have set my PATH variable to use the first version. Running "which python3" routes to this version: /usr/local/bin/python3 -- this is what I want.
Unfortunately, pip3, and yet another version of Python, are installed in a different location (I think the version that comes pre-installed with mac). When I run "pip3 --version" I get the below:
pip 20.1.1 from /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip (python 3.7)
Shouldn't these match? Is there a way to make sure python3 uses the pip3 version via /usr/local/bin/pip3? Do I just need to change / add it to my path somehow?
Another option is to uninstall everything with homebrew (what I used to originally install python3), and then reinstall. However, apparently, per my co-worker, we need to stay on python3.7. I'm worried if I reinstall python3, it will default to 3.8 or higher.
Please help!
There are a few things that I have found increase the chances of success here:
don't mess with the Mac-installed default Python
don't use homebrew to install Python
use pyenv to install and manage Python versions
Here's a useful write-up on The right and wrong way to set Python 3 as default on a Mac.
I've searched a while and haven't found an answer to this particular issue.
brew info python returns python: stable 3.7.7 (bottled), HEAD
However, python -V and python3 -V return Python 3.6.1 :: Anaconda 4.4.0 (x86_64)
Why is my Mac python version different than what I've installed with HB, and how can I fix it? Thank you!
One version of python was installed using the Anaconda distribution. The other by Homebrew. It's not surprising that they are different versions. You should run in virtual environments and then you won't need to worry about 2 versions. Using the Anaconda distribution it is easy to set up a virtual environment to run that version.
Erg. Yes—this is a challenge sometimes. macOS ships with python as part of its system. Catalina 10.15.4 ships with /usr/bin/python3 of 3.7.3. brew (at the moment) has installed 3.7.7 as its stable branch, but it also offers a python#3.8 which installs 3.8.2. That's significant because there are other brew packages (notably vim) which specity python#3.8 as a dependency. Yuck.
I'm not running anaconda at the moment, but I'll take your word that it's yet-another version.
Whichever appears first in your path is going to prevail unless you're operating inside a context like a virtual environment. You can arrange your path to set your preferred python3 to run. You can always check which python3 is running by using "which python3" and that will give you the full path of the running program.
Word of caution: Each distinct python3 will maintain its own packages library. Once you have your paths sorted out, you should manage your packages with "python3 -m pip " to be sure you're managing the libraries for your intended version.
And yes—eventually, it'd probably be good for us to work in virtual environments or skip straight to Docker containers.
I want to install jupyter on Win 10. I have been using python on linux, but this is my first time on Win 10.
when I execute python -m pip install jupyter on administrator, I got errors like this:
The package setup script has attempted to modify files on your system
that are not within the EasyInstall build area, and has been aborted.
This package cannot be safely installed by EasyInstall, and may not
support alternate installation locations even if you run its setup
script by hand. Please inform the package's author and the EasyInstall
maintainers to find out if a fix or workaround is available.
any idea?
I have been able to get around this error by installing Anaconda, uninstalling Python 3.8.0 and installing Python 3.7.5 instead.
The Jupyter installation then ran successfully when I executed pip install jupyter with Git Bash in my C:\ drive using pip 19.2.3 (the default with Python 3.7.5).
For those who encounter this and need to use Python 3.8+, make sure to update you setuptools to version 42.0.0 (or later).
Install a version earlier than python 3.8 and the installation will work. Use CMD.
I had the same problem, I am using 64-bit windows 10 but downloaded the 32-bit python installer because it is the default that appears on the 'downloads' page on the python.org site. Uninstalled python 3.8.1, downloaded the 64-bit installer instead, and then ran 'pip install jupyterlab' using the pip version 19.2.3 that got installed with the 64-bit python instead of upgrading to pip version 19.3.1. So if you are running a 64-bit version of windows, make sure you download the 64-bit python installer!
I want to install Scrapy on my Mac. I am a complete Python newcomer. I know Mac OS X comes pre-installed with a version of Python. However, best practice (I followed this video), including Scrapy's own advice, appears to recommend installing a "proper" version that does not conflict.
I used "brew install python". This installed Python 2.7.12.
I also used "brew install python3". This installed Python 3.5.2.
OS X appeared to ship with 2.7.6.
I added "export PATH=/usr/local/share/python3:$PATH" to the path, to ensure shells start with Python 3.
Current path is "/usr/local/share/python3:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
I believe the second path is the 2.X one I installed myself.
Now that it comes to installing Scrapy, I am confused. Scrapy install documentation says to use "pip install Scrapy". However, I'm not sure whether this will run pip for the pre-installed Python, my new 2.X Python or my new 3.X Python.
Should I run "pip install Scrapy" or "pip3 install Scrapy"? My instinct says the former.
Being new to Python, I'd love to clear up a few points that I couldn't get from reading various articles and tutorials.
After using Homebrew to install Python3, I noticed that it had installed both Python3 and Python3.4. I was also a little surprised that there are now three versions of pip on my machine too; pip, pip3 and pip3.4.
I created a new virtualenv and told it to use Python3, using the following command:
virtualenv -p /usr/local/bin/python3 mysite
I was also surprised that the version of Python that it installed in my VM was 3.4.
Is it safe to have these multiple version of Python and Pip hanging around on my machine?
Am I right to assume that I should take extra care to use the matching version of pip with Python, for example, pip3.4 with Python3.4?
Yes, it is safe. Python uses this naming like python3.4, python3.5 etc to differentiate between releases. python3 is a symbolic link to the current python3.x version. Pip follows the same convention.
If you're using python3.4 explicitly, you should be using pip3.4 specifically as well. Otherwise, just use python3 and pip3. For Python 2, you can simply use python (which, unless you installed the Homebrew version as well), will be the system Python), and ditto for pip. python2.7 and pip2.7 may also work.
In general, to find out which Python version goes with which pip you're using, try:
pip --version
and you'll see the Python included in the result.
No need to worried about if you have multiple version of Python and Pip installed. just check your version by writing in terminal :
$ brew info python
or to check the version of pip write in terminal :
$ brew info pip
and make sure you have updated your both pip and python version (write in terminal $ brew upgrade pip/python)
and other way to install python is go to https://www.python.org/downloads/ and choose as your requirement, there is two version available 2.7.9 & 3.4.3 ,
after installing python write in terminal $ python -V to check its version :) Hope it will help :)