Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Python 

Using pip with multiple versions of Python installed

So I already have 2 versions of Python installed (2.7 and 3.7) but I want to get into machine learning with tensorflow.  
Tensorflow requires Python version 3 or above, but doesn't support 3.7 so I installed Python3.6.

Now in Python36/Scripts I have pip3.6.exe and pip3.exe. If I try to install tensorflow like so
Code
pip3.6.exe -m install tensorflow

I get the following error output

Code
Traceback (most recent call last):
 File "g:\python3.6.8\lib\runpy.py", line 193, in _run_module_as_main
   "__main__", mod_spec)
 File "g:\python3.6.8\lib\runpy.py", line 85, in _run_code
   exec(code, run_globals)
 File "G:\Python3.6.8\Scripts\pip3.exe\__main__.py", line 5, in <module>
ModuleNotFoundError: No module named 'pip'

I tried renaming pip3.6 to just pip but it didn't work, so any help would be greatly appreciated!


EDIT:
I found a solution (workaround?) by installing pip via easy_install
Code
easy_install-3.6.exe pip

Still can't install tf, but that's a seperate issue...
[Image: 0DvFxnA.gif]
Donate: 3ABKRghau93ziRaDfVwiiwtjky3i1gLrKn
Code
python -m pip install package
always works using the correct python path variable
What integrated development environment are you using?
Use virtualenv for that purpose and for development as well it will help you to not thrash your system with different packages but keep only necessary ones, same will go for development environment
Create environment
Code
virtualenv --python=/usr/bin/python3.6 <path/to/new/virtualenv/>
Or change path to python above.
To activate environment use:
Code
source <path/to/new/virtualenv/bin/activate>
to deactivate simply write deactivate.
Make a favor to yourself and don't install them like that, but rather use PyEnv. It will save you from tons of frustration as soon you set it up and running.
You forgot pip. Instead of "pip3.6.exe -m install tensorflow" do "pip3.6.exe -m pip install tensorflow"


Possibly Related Threads...
Thread / Author Replies Views Last Post
by codeethan88Jan 4, 2025 08:53 AM 15 346 Jan 4, 2025 08:53 AM
Last Post: SIM-5604220
[Python] by Bass_ReevesAug 20, 2023 01:44 AM 9 632 Aug 20, 2023 01:44 AM
Last Post: Lucky4L
by dbCookerJun 10, 2023 08:38 AM 5 209 Jun 10, 2023 08:38 AM
Last Post: Hackers