Using virtualenv with canopy

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Using virtualenv with canopy

Amit Aides
Hello,

I am using canopy on a windows 7 64bit. I have installed virtualenv
(1.7) through the package manger of canopy. When I try to create a new
environment I get the following error:

D:\amit>virtualenv virutalen1
Traceback (most recent call last):
   File
"C:\Users\amitibo\AppData\Local\Enthought\Canopy\User\Scripts\virtualenv-script.py",
line 10, in <module>
     sys.exit(main())
   File
"C:\Users\amitibo\AppData\Local\Enthought\Canopy\User\lib\site-packages\virtualenv.py",
line 928, in main
     never_download=options.never_download)
   File
"C:\Users\amitibo\AppData\Local\Enthought\Canopy\User\lib\site-packages\virtualenv.py",
line 1029, in create_environment
     site_packages=site_packages, clear=clear))
   File
"C:\Users\amitibo\AppData\Local\Enthought\Canopy\User\lib\site-packages\virtualenv.py",
line 1166, in install_python
     copy_required_modules(home_dir)
   File
"C:\Users\amitibo\AppData\Local\Enthought\Canopy\User\lib\site-packages\virtualenv.py",
line 1118, in copy_required_modules
     dst_filename = change_prefix(filename, dst_prefix)
   File
"C:\Users\amitibo\AppData\Local\Enthought\Canopy\User\lib\site-packages\virtualenv.py",
line 1103, in change_prefix
     (filename, prefixes)
AssertionError: Filename
C:\Users\amitibo\AppData\Local\Enthought\Canopy\App\appdata\canopy-1.0.0.1160.win-x86_64\lib\os.py
does not start with any of these prefixes:
['C:\\Users\\amitibo\\AppData\\Local\\Enthought\\Canopy\\User']

I will appreciate any help,
Thanks,
Amit

_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: Using virtualenv with canopy

Corran Webster
Hi Amit,

don't use virtualenv.  Canopy uses a backport of Python 3's venv in very fundamental ways, but is not compatible with virtualenv.  Within canopy you can create a new virtual environment using:

venv -s path/to/virtual_environment_dir

and then activate it as you would a regular virtual environment.

The one additional feature you will need to be aware of is that with the current implementation you will need to manually update the python interpreter that the virtual environment uses whenever a Canopy update is distributed using:

venv -u path/to/vurtual_environment_dir

In the future we would like to expose this virtual environment functionality in a more straightforward way through the Canopy application. In the interim, we are very interested in any feedback on the current implementation that you might be able to give us as an advanced user who needs the features provided by virtual environments.

Best Regards,
Corran


On Mon, May 27, 2013 at 4:24 PM, Amit Aides <[hidden email]> wrote:
Hello,

I am using canopy on a windows 7 64bit. I have installed virtualenv
(1.7) through the package manger of canopy. When I try to create a new
environment I get the following error:

D:\amit>virtualenv virutalen1
Traceback (most recent call last):
   File
"C:\Users\amitibo\AppData\Local\Enthought\Canopy\User\Scripts\virtualenv-script.py",
line 10, in <module>
     sys.exit(main())
   File
"C:\Users\amitibo\AppData\Local\Enthought\Canopy\User\lib\site-packages\virtualenv.py",
line 928, in main
     never_download=options.never_download)
   File
"C:\Users\amitibo\AppData\Local\Enthought\Canopy\User\lib\site-packages\virtualenv.py",
line 1029, in create_environment
     site_packages=site_packages, clear=clear))
   File
"C:\Users\amitibo\AppData\Local\Enthought\Canopy\User\lib\site-packages\virtualenv.py",
line 1166, in install_python
     copy_required_modules(home_dir)
   File
"C:\Users\amitibo\AppData\Local\Enthought\Canopy\User\lib\site-packages\virtualenv.py",
line 1118, in copy_required_modules
     dst_filename = change_prefix(filename, dst_prefix)
   File
"C:\Users\amitibo\AppData\Local\Enthought\Canopy\User\lib\site-packages\virtualenv.py",
line 1103, in change_prefix
     (filename, prefixes)
AssertionError: Filename
C:\Users\amitibo\AppData\Local\Enthought\Canopy\App\appdata\canopy-1.0.0.1160.win-x86_64\lib\os.py
does not start with any of these prefixes:
['C:\\Users\\amitibo\\AppData\\Local\\Enthought\\Canopy\\User']

I will appreciate any help,
Thanks,
Amit

_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev


_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev