0

When I was trying to create a virtual Env on Cygwin by:

$virtualenv venv

However, it returns error:

AssertionError: Filename C:\Python367\Lib\os.py does not start with any of these prefixes: ['C:\\python367', 'C:\\python367']

I tried all the solutions under this problem virtualenv on windows 7 returns AssertionError, but it doesn't help.

lyn
  • 53
  • 8

1 Answers1

0

After I seek help from other people, I get the root cause:

I was using the python and virtualenv which installed in my windows system, so thus cased the error I put in my question.

$ which python
/cygdrive/c/Python367/python <== the python I'm using there is installed in my windows system

The solution is, install the python and virtualenv on Cygwin, and then create the virtualenv by the same command. After that you can see the python path is under:

$ which python3
/usr/bin/python3 

$ pip3 install virtualenv
Collecting virtualenv

This works for me!

lyn
  • 53
  • 8