After experiencing this brew issue with sqlite3, I did
brew rm sqlite python python3
then
brew install python python3
This installed python2.7.5 as the default interpreter and as brew installs pip along with python, I thought I would be able to
pip install virtualenv
to install virtualenv for the new python2.7.5. However, I'm getting
-bash: /usr/local/share/python/pip: /usr/local/Cellar/python/2.7.3/bin/python: bad interpreter: No such file or directory
How can I get around/fix this? Should I be creating a symlink between
/usr/local/share/python/pip --> /usr/local/Cellar/python/2.7.5/bin/pip-2.7
One of the most common problems with running Python tools like pip is the “not on PATH” error. This means that Python cannot find the tool you're trying to run in your current directory. In most cases, you'll need to navigate to the directory in which the tool is installed before you can run the command to launch it.
To use pip to uninstall a package locally in a virtual environment: Open a command or terminal window (depending on the operating system) cd into the project directory. pip uninstall <packagename>
To install a specific version of a Python package you can use pip: pip install YourPackage==YourVersion . For example, if you want to install an older version of Pandas you can do as follows: pip install pandas==1.1. 3 .
Pip is usually bundled with Python and updates automatically, but in you might want to manually upgrade and manage it. This is what we'll be teaching you today. This process should work whether you're using pip on Linux, Windows, or macOS.
It sounds like your /usr/local/share/python/pip
is pointing to the wrong version of Python. Check the first line of that file, and if it looks like...
#!/usr/local/Cellar/python/2.7.3/bin/python
...then you'll need to change it to point to the correct version of Python.
The python3 homebrew package installs pip as pip3. You can even install multiple versions of python 3, e.g. python 3.2 and 3.3 and each will get linked as pip-3.3 and pip-3.2.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With