Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

Problem importing libraries

#1
Hello, 

I have a Python code I use for a calibration project and it works well if i run it with VScode. If I import it to roboDK and run it from there, it returns me an error (attached image) because of libraries such as pyautogui, OpenAI, and Image from PIL that are not installed. I tried changing the python interpreter (Tool -> options -> Python) with the instruction "import_install" but it didn't work. Could you please help me solve this problem? 

Thank you in advance 

Best regards, 
Maroua


Attached Files Thumbnail(s)
robodk erreur.png   
#2
To make Python scripts work the same way they work on VSCode you should setup the same Python interpreter you use in VSCode in RoboDK by following these steps:
  1. Select Tools-Options
  2. Select the Python tab
  3. Enter the correct Python interpreter
Alternatively, you can run install Python packages in the Python interpreter used in RoboDK by selecting Tools-Run Script and then select the Install Python Package script.
#3
Hello,

I followed your instructions step by step, but it still didn’t work in either case:
1. I went to Tools → Options → Python in RoboDK and pointed it to the exact same Python executable I use in VS Code. Despite that, my scripts still fail when importing modules like pyautogui.(attached images)
2. I opened Tools → Run Script, selected the “Install Python Package” script, and installed the required packages ( pyautogui and OpenAI) into RoboDK’s interpreter. Even after a successful install message, the imports still raise “module not found” errors. (attached images)

Please let me know if there are any other troubleshooting steps I should follow.

Best regards,


Attached Files Thumbnail(s)
VS Code interpreter .png    python interpreter robodk .png    robodk error 1.png    robodk interpreter .png   
Image(s)
   
  




Users browsing this thread:
1 Guest(s)