Announcements
Autodesk Community will be read-only between April 26 and April 27 as we complete essential maintenance. We will remove this banner once completed. Thanks for your understanding

numpy in VRED 2021

j.kaestle
Enthusiast

numpy in VRED 2021

j.kaestle
Enthusiast
Enthusiast

Hi,

we use numpy in our VRED Scripts for some matrix calculations. Now we want to switch to VRED 2021. How to install numpy for VRED 2021?

I think the way described here is not working, because on this site is no Python 3.7 compiled with the appropriate Visual Studio Version.

I found in the VRED Python Folder a pip.exe. When I run this, I get an error message.

Any ideas?

Or in general: How to install Python modules for VRED?

 

Thanks

 

Jochen

Reply
Accepted solutions (1)
1,037 Views
5 Replies
Replies (5)

michael_nikelsky
Autodesk
Autodesk

VRED 2021 uses the official python 3.x builds so you just need to start the python that ships with VRED and install modules as you normally would:

 

pip install numpy

 

Custom building of python modules should not be necessary anymore since the official python 3.x builds use a proper compiler now. 

 

Kind regards

Michael



Michael Nikelsky
Sr. Principal Engineer
0 Likes

j.kaestle
Enthusiast
Enthusiast

Hi Michael,

I found the pip.exe in the folder 

C:\Program Files\Autodesk\VREDPro-13.1\lib\python\Scripts

When I run this pip in a command window, I get following message:

Fatal error in launcher: Unable to create process using '"c:\users\kellerm\appdata\local\programs\python\python37\python.exe"

Seems it is pointing to a python Installation in a user Folder.

Am I wrong?

 

Kind regards

Jochen

0 Likes

j.kaestle
Enthusiast
Enthusiast
Accepted solution

Hi,

I found a way to install numpy for our current VRED Version:

I installed Python 3.7 on my Workstation, then installed numpy with pip for this Python. Copy the numpy Folder to the site-packages of the VRED Python. Now everything is running.

 

Kind regards

Jochen

0 Likes

markus_keller
Autodesk
Autodesk

Unfortunately there are a couple of problems:

1) pip.exe is apparently not relocatable. You can see in the error message that it has a hardcoded path that was created by the original Python installer.. I'm going to remove pip.exe from the VRED installation.

The way to use pip is to call "python.exe -m pip" instead of using pip.exe. It does the same, pip.exe is just there for convenience.

 

2) The solution above does unfortunately also not work for 2021.1. I think it's because setuptools is missing from site-packages. This will be fixed in the next release.

 

But there is still a way to correct this:

Run "python.exe -m ensurepip"

This will correct all pip errors and install all dependecies like setuptools.

Then you can install numpy with 'python.exe -m pip install numpy". 

Just make sure you have write access to the VRED installation.



Markus Keller
Principal Engineer
0 Likes

j.kaestle
Enthusiast
Enthusiast

Hi,

thank you for the Information.

I tested my solution with VRED 2021.1 and it is working fine. My scene is running as expected without any problems or error messages related to numpy.

Here are some more Details, what I did. Maybe this information is helpful.

  • I installed Python 3.7.8 only for my user. I know, VRED uses a Version which is a Little bit older. I was to lazy to search this Version and I took the latest Python 3.7
  • becaus I am sitting behind our companys Firewall, I must run pip with additional parameters:
    pip --proxy http://user:passwort@proxy:port install numpy
  • I copied both folders (numpy & numpy-1.19.1.dist-info) to VREDs site-packages folder. I think the second folder is not neccessary. I didn't want to spend the time to test it.
  • To be sure, to have no side-effect when testing, I de-installed my Python and restarted the Computer.

Currently this was done for only one machine and VRED Pro. When all is upgraded to Python 3.7, we will install VRED 2021.1 Design on several other machines. If we face any Problems, I will come back to your solution and I will add the information here.

 

Kind regards

Jochen

0 Likes