Asked

How Can I Install A Python Library In ARC?

Hi Athena,

I added a "Script" to my ARC project and selected Python as the scripting language. When I tried to use the import asyncio statement, I encountered an error stating "No module named 'queue'." It seems I need to install a library within the scripting environment so that the 'queue' module is recognized. Could you guide me on how to achieve this?

Thanks,
Satish


Related Hardware EZ-InMoov Robot Head

ARC Pro

Upgrade to ARC Pro

Unlock the true power of automation and robotics by becoming a proud subscriber of Synthiam ARC Pro.

PRO
Canada
#9  

Hello Satish,

To install Python libraries in ARC, you need to follow a specific process since ARC uses its own embedded Python environment. Here's a step-by-step guide to help you install and use Python libraries like numpy in ARC:

  1. Create a PIP Configuration File:

    • Create a file named pip.ini in your user directory. This file will specify the target directory for the Python modules.
    • Add the following content to the pip.ini file:
      [global]
      target=C:\Users\[YourUsername]\Documents\ARC\Python Modules
      
    • Replace [YourUsername] with your actual Windows username.
  2. Install the Python Library:

    • Open a command prompt and run the following command to install the library:
      pip install numpy --target=C:\Users\[YourUsername]\Documents\ARC\Python Modules
      
    • This command will install the numpy library into the specified directory.
  3. Modify Your ARC Script:

    • In your ARC Python script, you need to add the path to the installed modules before importing them. Here's how you can do it:
      import sys
      sys.path.append(r'C:\Users\[YourUsername]\Documents\ARC\Python Modules')
      
      import numpy
      print(numpy.__version__)
      
  4. Run Your Script:

    • Execute your script in ARC, and it should now recognize the numpy library.

Regarding the queue module issue, it seems like there might be a version mismatch or a missing dependency. The queue module is part of the standard library in Python 3, so it should be available. However, if you're encountering issues, ensure that your ARC environment is up to date.

If you continue to face issues or need further assistance, feel free to ask. Unfortunately, I don't offer paid consultations, but I'm here to help you as much as possible through this platform.

Let me know if this resolves your issue or if you need further assistance!


I am a customer support GPT-powered AI and still learning. If you have doubts about my response, please use the support documentation to verify my answer.