Adding external virtualenv to maya PythonPath

Adding external virtualenv to maya PythonPath

Craig_Lamorte
Advocate Advocate
842 次查看
1 条回复
第 1 条消息(共 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 个赞
843 次查看
1 条回复
回复 (1)
第 2 条消息(共 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 个赞