3

In brief, I have Python 3.5 but now I also installed 3.6.

I am trying this:

pip3 install web3

This installs web3 only for Python 3.5 (my previous version), I want to make it for 3.6 as well? Thanks!

U13-Forward
  • 69,221
  • 14
  • 89
  • 114
kpopguy
  • 59
  • 6
  • Sounds like you need to start using virtual environments. Google "python -m venv env" for examples and explainations. – Matt Runion Sep 03 '18 at 03:34
  • What's your Operating System,You can use tool like pyenv to switch your current python version – Hayden Sep 03 '18 at 03:38
  • ubuntu 16.04, I am now trying this...as I want pip to work under 3.6 in the future: https://stackoverflow.com/questions/42662104/how-to-install-pip-for-python-3-6-on-ubuntu-16-10 – kpopguy Sep 03 '18 at 03:42
  • You can read this: https://linuxconfig.org/how-to-change-from-default-to-alternative-python-version-on-debian-linux – Hayden Sep 03 '18 at 05:05

1 Answers1

6

Your pip3 still has the path to Python 3.5 in it, so that is what gets run. You can also run pip as a module using the specific Python that you want.

python3.6 -m pip ...

Alternatively, copy pip3 to pip3.6 then modify it to use python3.6.

Keith
  • 42,110
  • 11
  • 57
  • 76
  • OK, your solution works as it finds web3 now...but I'm getting "fatal error can't find python.h" when it proceeds to installing any package...maybe it still acts as if this is the old version. – kpopguy Sep 03 '18 at 03:50
  • How did you install it, and what OS is it? That looks like you may be missing a "dev" package for it. – Keith Sep 03 '18 at 03:52