Adding external virtualenv to maya PythonPath

Adding external virtualenv to maya PythonPath

Craig_Lamorte
Advocate Advocate
582 Views
1 Reply
Message 1 of 2

Adding external virtualenv to maya PythonPath

Craig_Lamorte
Advocate
Advocate

Hi,

 

I currently have maya working with some custom scripts, and I link them by editing the maya.env file and putting - PYTHONPATH = C:/custom_scripts

I now need some external python packages I need to be able to import in my scripts, and instead of just dropping those packages into my custom_scripts folder, I wanted to create a virtualenv, and then pip install everything I needed.  I tried creating the custom_scripts folder as my virtual_env and then pointing to the site-packages folder in the PYTHONPATH in maya.env.  That caused some errors.  Would be the best way to create a virtualenv, and point it to my scripts and allow them to have access to all the pythonpackages i installed to this virtualenv?

0 Likes
583 Views
1 Reply
Reply (1)
Message 2 of 2

Craig_Lamorte
Advocate
Advocate

I did this
Custom_tools
    |__ custom_scripts
            |__ my custom python scripts
    |__ VirtualEnv
            |__ Lib
                   |__ Site-Packages

I set the PYTHONPATH in maya.env to point to the custom scripts folder and the site-packages folder and that worked.  I was hoping to contain my custom scripts inside the virtualenv root folder but when I did that it would error out maya
      

0 Likes