1

I am trying to update the module vpython to the most current version. I run:

pip3 install --user vpython --upgrade

in a Jupyter terminal. This gives the error:

ERROR: jupyter-server-proxy requires Python '>=3.5' but the running Python is 3.4.2

But when I run:

python3 --version

it returns:

Python 3.5.2 :: Anaconda 4.1.1 (64-bit)

Is there something going wrong with the installed Python3 kernel for Jupyter?

Geroditus
  • 131
  • 3
  • 1
    Do `python3 -m pip install xxxx`. You're having a version conflict. Check `pip3 --version` and it will probably give you `python 3.4`. If so you might be able to use `pip3.5 install` – Teshan Shanuka J Mar 17 '20 at 18:01
  • 1
    Does this answer your question? [Install a module using pip for specific python version](https://stackoverflow.com/questions/10919569/install-a-module-using-pip-for-specific-python-version) – lainatnavi Mar 17 '20 at 18:03

2 Answers2

0

Change the environmental variable in your control panel just a simple conflict between python 3.4 and 3.5 this will surely solve your issue.

  • No, this will possibly cause additional problems. `pip` is installed as both a binary on OP's machine and as a module in each installation of python. OP just needs to call `python -m pip install ` and this problem is avoided – C.Nivs Mar 17 '20 at 18:23
  • Yes, brother, you are right but the computer must detect python 3 .5 is installed so first he must add it to the environment right?? –  Mar 17 '20 at 18:28
  • In a standalone instance, you'd be right. But anaconda handles that in the background for you when you activate an environment, so `$PYTHONPATH` gets modified to point to that particular interpreter. The solution is that OP shouldn't be using the standalone `pip3`, but the module `pip` that's tied to the interpreter they want – C.Nivs Mar 17 '20 at 18:34
0

The issue is that you are using pip3 which is not always tied to the specified python you are trying to run. pip is a module installed with each python3 instance, so to specify it to install to a python environment, use the -m flag:

python -m pip install <module>

Where python is the python that you expect. For instance, if you want it to run against the installation that you use through python3, then you would do python3 -m pip install <module>. This makes things easy to track, since if you want to see which python you are installing to, you can use python -m pip -V. On my machine that outputs:

pip 19.3.1 from /Users/mm92400/anaconda3/lib/python3.6/site-packages/pip (python 3.6)
C.Nivs
  • 12,353
  • 2
  • 19
  • 44
  • That seems to have done something, but when I check the version of the package, it still says 7.4, instead of 7.6, which is what I need. I am running pip with the --user flag, so is it just not updating because I don't have permissions to do it globally? – Geroditus Mar 17 '20 at 18:31
  • If you didn't have permissions, it should throw an error indicating so. Since it hasn't, I think you're ok for permissions. How are you checking the version of that package? – C.Nivs Mar 17 '20 at 18:36
  • And are you using a `conda` environment or just the base install? – C.Nivs Mar 17 '20 at 18:37
  • I used ```python3 -c "import pkg_resources; print(pkg_resources.get_distribution('construct').version)"``` It actually appears to have updated to 7.6 now after running it again, but when I run ```import vpython``` I get an ImportError: No module named 'vpython' – Geroditus Mar 17 '20 at 18:50
  • Where are you running `import vpython` from? – C.Nivs Mar 17 '20 at 19:45
  • inside a .py file, from a Jupyter Python3 notebook – Geroditus Mar 17 '20 at 20:06