loading
 
How do I tell Roborealm the path to Python Modules?
Carter from United States  [12 posts]
1 year
Hello!

To aid in debugging our code for this year's challenge I was hoping to write variables to an excel sheet so I can have a record of them (without too much manual labor) for lots of different robot/tower configurations. I want to do this using the xlsxwriter python module as I have done with a project before. From this past example I know that I have the module installed and added to the correct computer path. However, when I try to load the file in RoboRealm, python's unable to find the module and I'm not sure how to point it in the right direction. I've tried os.chdir() to the directory with the module and then back to the path with the python script I'm running, but it still can't find it. Do you have any suggestions?
Thanks!
Steven Gentner from United States  [1370 posts] 1 year
Carter,

You can download the most recent version which has additional checks for that. Its most likely that it IS finding it but cannot load the DLL due to missing dependencies ... a missing dll OR a missing dependency looks the same to an app.

I'd recommend checking python35.dll with dependency walker to find out which dll you are missing. Most likely (which just happened the other day):

http://www.roborealm.com/forum/index.php?thread_id=5711#

Please read that post too.

STeven.
Carter from United States  [12 posts] 1 year
Hi STeven,

I'm kind of new to this and am not sure what a dependency walker is or where to download it and how to use it. Could you please walk me throughout it? (It's hard to figure out the relevant information when simply googling it).

Also the problem the other day in that post was getting the roborealm python module to work (which the update or downloading that file fixes). However, my problem is slightly different. Roborealm is able to run its python module fine. What it can't find is the xlsxwriter module (http://xlsxwriter.readthedocs.org/) that I installed in python using pip (it's path directory is C:\Python34\Lib\site-packages\xlsxwriter). So when I run the python source program in RR I get the message "ImportError: No module names 'xlsxwriter'" when my script say import xlsxwriter.
Steven Gentner from United States  [1370 posts] 1 year
Carter,

My bad ... I read your question incorrectly.

After testing that package I got the same error and guessed that the python34.dll probably doesn't handle the .egg format correctly. So I copied

.\XlsxWriter-0.8.4\xlsxwriter

folder to the Lib\site-packages and the problem went away (tested with Python35).

Do you have a xlswriter folder in your site-packages or just the XlsxWriter-0.8.4-py3.4.egg file?

The path is determined by the python.dll executable. If RR finds that then it should also be able to find its site-package folder.

Now, if you are like me and have 4 python versions installed you may not be installing in the one that RR is using ... so check to see how many and where you have python34.dll located. Its possible you are installing in one but running another (like what happened to me when testing).

STeven.

Carter from United States  [12 posts] 1 year
Hi STeven,

No problem; when I looked back at my original question I realized how poorly worded it was!

The folder was in my site-packages, but it was for a different python version not the one I thought I was using. I hadn't even realized until you asked that I had more than one version of python installed. (Thanks for bearing with me. I had never worked with python until FIRST season started this year and I'm still teaching myself as I go!)

After getting rid of the older version and re-installing the xlsxwriter module everything is working fine!

Thank you again!

This forum thread has been closed due to inactivity (more than 4 months) or number of replies (more than 50 messages). Please start a New Post and enter a new forum thread with the appropriate title.

 New Post   Forum Index