https://github.com/ellerbrock/osx-python-pip-problems
:feelsgood: fix for problems with python and pip on macos
https://github.com/ellerbrock/osx-python-pip-problems
macos osx pip2 pip3 pipeline pipenv python python-2 python-3
Last synced: 10 months ago
JSON representation
:feelsgood: fix for problems with python and pip on macos
- Host: GitHub
- URL: https://github.com/ellerbrock/osx-python-pip-problems
- Owner: ellerbrock
- License: mit
- Created: 2018-01-14T02:32:45.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-01-14T02:37:18.000Z (almost 8 years ago)
- Last Synced: 2025-01-19T02:52:22.600Z (12 months ago)
- Topics: macos, osx, pip2, pip3, pipeline, pipenv, python, python-2, python-3
- Size: 62.5 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README

# Fix for problems with Python and pip
[](https://github.com/ellerbrock/open-source-badges/) [](https://gitter.im/frapsoft/frapsoft/) [](https://opensource.org/licenses/mit-license.php)
## Problem
Today i run in some weird issues installing some tools that after the dependencies where installed the i got error messages that they would not be there. Running direct the Python Shell showed me that its working fine.
After a bit research i found out that Mac have an own Python version and stuff get then mixed up with the version from homebrew. Thought beeing smart and drop an alias got it did not solve the problem since mostly run in the scripts via Shebang.
The fix is to install a tool called `pipenv` for isolationg them from each other (similar like `nvm` for Node.js).
To see how many Python versions are installed run `type -a python`.
## Let's fix it
### Install pipenv
`pip install --user pipenv`
### Update PATH Variable
Add this folder before $PATH
`echo "$(python -m site --user-base)/bin"`
## How to use it
### Go to your Folder
`cd myproject`
### Install request
`pipenv install requests`
*remember to use always pipenv instead of pip from now!*
### Execute the App
Starting it like before e.g. `./app.py` won't work, you have to run it as well with
`pipenv run python app.py`
Thats it.
Hope i can save others in the future with this tipps some time.
## Contact
[](https://github.com/ellerbrock/)[](https://hub.docker.com/u/ellerbrock/)[](https://www.npmjs.com/~ellerbrock)[](https://twitter.com/frapsoft/)[](https://www.facebook.com/frapsoft/)[](https://plus.google.com/116540931335841862774)[](https://gitter.im/frapsoft/frapsoft/)
## License
[](https://opensource.org/licenses/mit-license.php)
This work by Maik Ellerbrock is licensed under a Creative Commons Attribution 4.0 International License and the underlying source code is licensed under the MIT license.