0

I recently updated from Python 3.5 to Python 3.6 and am trying to use packages that I had previously downloaded, but they are not working for the updated version of Python. When I try to use pip, I use the command "pip install selenium" and get the message "Requirement already satisfied: selenium in /Users/Jeff/anaconda/lib/python3.5/site-packages" How do I add packages to the new version of Python?

4
  • pip install package --upgrade Commented Jun 6, 2017 at 18:12
  • Maybe pip3.6 install package. Commented Jun 6, 2017 at 18:14
  • @Matthias - that did the trick. Thanks! Commented Jun 6, 2017 at 19:26
  • @Jeff: So pip seems to link to pip3.5 in the Python 3.5 installation. Commented Jun 6, 2017 at 21:10

1 Answer 1

1

First, make sure that your packages do have compatibility with the version of Python you're looking to use.

Next, run pip freeze > requirements.txt in the base directory of your Python project. This puts everything in a readable file to re-install from. If you know of any packages that require a certain version that you'll want to re-install, put package==x.x.x (where package is the package name and x.x.x is the version number) in the list of packages to make sure it downloads the correct version.

Run pip uninstall -r requirements.txt -y to uninstall all packages. Afterwards, run pip install -r requirements.txt.

This allows you to keep packages at the correct version for the ones you assign a version number in requirements.txt, while upgrading all others.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.