Tiago Peres
Tiago Peres

Reputation: 15476

Python (development environment): Install Python 3.5.2, pip, and virtualenv on Windows

I'm having a problem trying to get the PowerShell virtualenvwrapper installed.

Bellow is the process I'm going through:

/******

Experienced Python/Django developers often choose to instead run their Python apps within independent Python virtual environments.

These allow developers to have multiple different Django environments on a single computer, allowing them to create new websites (using the latest version of Django)while still maintaining websites that rely on older versions.

The Django developer team itself recommends that you use Python virtual environments.

******/

1. Access PowerShell as admin

cd C:\

mkdir Django

cd Django

2. Get Python 3.5.2 (32 bits is the one I suggest) - https://www.python.org/downloads/release/python-352/

Customize the location: C:\Python35-32

(make sure is installed in your path)

Once you’ve installed Python, open up a PowerShell window and

python

This is what you will see:

 Python 3.5.2 (v3.5.2:4def2a2901a5, Jun 25 2016, 22:01:18) [MSC v.1900 32 bit (Intel)] on win32
 Type "help", "copyright", "credits" or "license" for more information.
>>>

------------------- (CTRL + Z to exit the Python prompt)

3. Get Pip

Save the following script as get-pip.py:

https://bootstrap.pypa.io/get-pip.py (if you can not find it, ask me for a copy)

python get-pip.py

To check if everything is working, just type pip at the command line:

pip

Then, if all goes ok,

pip install --upgrade setuptools

pip install ez_setup

4. Install virtualenv and virtualenvwrapper-powershell

pip install virtualenv

(all good)

pip install virtualenvwrapper-powershell

(having a problem here)

C:\Django>pip install virtualenvwrapper-powershell

Collecting virtualenvwrapper-powershell

  Using cached virtualenvwrapper-powershell-12.7.8.zip

    Complete output from command python setup.py egg_info:

    Traceback (most recent call last):

      File "<string>", line 1, in <module>

      File "C:\Users\USERHP~1\AppData\Local\Temp\pip-build-9qxnn_l2\virtualenvwrapper-powershell\setup.py", line 76
        TOKEN_READ = 0x00020000L | 0x0008
                               ^
    SyntaxError: invalid syntax

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in
C:\Users\USERHP~1\AppData\Local\Temp\pip-build-9qxnn_l2\virtualenvwrapper-powershell\

What can I do here?

Thank you for the support

Upvotes: 2

Views: 751

Answers (1)

Tiago Peres
Tiago Peres

Reputation: 15476

virtualenvwrapper-powershell interacts nicely with Python 2.7. (https://pypi.python.org/pypi/virtualenvwrapper-powershell/2.7.1)

So, I suggest to install that as the system python AND then install Python 3.5.2 outside of the path.

Following steps:

  1. Install Python 2.7 ON the path

  2. Install Python 3.5.2 OFF the path

  3. pip

pip install --upgrade setuptools

pip install ez_setup

  1. pip install virtualenv

  2. pip install virtualenvwrapper-powershell

Upvotes: 2

Related Questions