Maya does some things when it comes to how it deploys python that just 
aren't compatible with virtualenv.
The biggest hurdle is that they zip up the entire standard library, while 
virtualenv likes to copy and enhance certain files from the standard 
library so as to operate properly.




On Wednesday, March 7, 2018 at 1:31:35 PM UTC-6, James Deschenes wrote:
>
>
> Has anyone had success with setting up virtual environments with mayapy? 
> I'm seeing the following error and I'm guessing that the issue is with the 
> python home and the binary being in different locations.
>
> C:\dev\hg_checkouts\mayaenv>virtualenv --python="C:\Program 
> Files\Autodesk\Maya2018\bin\mayapy.exe" test
> Running virtualenv with interpreter C:\Program 
> Files\Autodesk\Maya2018\bin\mayapy.exe
> PYTHONHOME is set.  You *must* activate the virtualenv before using it
> Traceback (most recent call last):
>   File "c:\python27\lib\site-packages\virtualenv.py", line 2328, in 
> <module>
>     main()
>   File "c:\python27\lib\site-packages\virtualenv.py", line 713, in main
>     symlink=options.symlink)
>   File "c:\python27\lib\site-packages\virtualenv.py", line 925, in 
> create_environment
>     site_packages=site_packages, clear=clear, symlink=symlink))
>   File "c:\python27\lib\site-packages\virtualenv.py", line 1145, in 
> install_python
>     site_filename_dst = change_prefix(site_filename, home_dir)
>   File "c:\python27\lib\site-packages\virtualenv.py", line 1036, in 
> change_prefix
>     (filename, prefixes)
> AssertionError: Filename C:\Program 
> Files\Autodesk\Maya2018\bin\python27.zip\site.py does not start with any of 
> these prefixes: ['C:\\Program Files\\Autodesk\\Maya2018\\Python']
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to python_inside_maya+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/134eaa48-9e52-4ea7-b9ef-0b50925b035d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to