0

I downloaded and installed python3.3 from the website and followed the instructions in the readme file.

I can run python3.3 from commandline, but when I try to install a package with pip, it will install to the default python (Anaconda python 3.6 in my case).

I tried installing a new pip using easy_install as described here, but it gives me the error saying

/usr/local/bin/python3.3: No module named easy_install

How can I install the setuptools if I don't have pip?

aeduG
  • 542
  • 5
  • 21
  • Possible duplicate of [How to install pip with Python 3?](https://stackoverflow.com/questions/6587507/how-to-install-pip-with-python-3) – phd May 07 '18 at 18:40

2 Answers2

0

I solved my problem by using the virtualenv from anaconda directly as described here.

conda create -n py33 python=3.3 anaconda

This will also setup pip, so installation of new packages is possible.

aeduG
  • 542
  • 5
  • 21
0

Does your Anaconda distribution (Python 3.6) have pip installed already? If yes, you can use virtualenv as virtual environment.

  1. Check if you have virtualenv installed. In my computer, I have virtualenv 16.0.0 installed.

    $ virtualenv --version
    16.0.0
    

    If it says, "command not found", you can install virtualenv.

    $ pip3 install virtualenv
    
  2. Once virtualenv is installed, create a new virtual environment, with Python 3.3. In the command below, we will create a new virtual environment called venv, that uses Python 3.3.

    $ virtualenv --python=/usr/bin/python3.3 <path/to/new/virtualenv/> venv
    

    If it says the path does not exist, check the path to python 3.3 using which command.

    $ which python3.3
    
  3. Activate the the virtual environment venv. The commands are activate to activate and deactivate to deactivate.

    $ source venv/bin/activate
    
  4. Install the package that you want.

    $ pip3 install X
    
  5. Once you are done and what to use the default Python 3.6, deactivate the virtual environment.

@aeduG's answer is correct. Alternatively, you can use virtualenv. See here for the differences between conda virtual environment and virtualenv.

See here if you want to use conda's virtual environment instead.

shiro.asakura
  • 36
  • 1
  • 5