Reputation: 11
I've been using IronPython to use functions in a C# .dll class library. I have also been using another set of packages called Psychopy. However, IronPython does not recognize Pyschopy packages. I tried placing a .pth file that said the following in IronPython's site-packages folder: C:/Program Files (x86)/PsychoPy2/Lib/site-packages/PsychoPy-1.80.03-py2.7.egg
I then changed the sys.prefix, sys.exec_prefix variables in site.py to "C:/Program Files (x86)/IronPython 2.7". Then, I went to the command line and in the ironpython shell, I tried to import psychopy. I received the following error:
Traceback (most recent call last):
File "<stdin>", line 1, in '<'module'>'
File "C:\Program Files (x86)\PsychoPy2\Lib\site-packages\PsychoPy-1.80.03-py2.7.egg\psychopy\__init__.py", line 33, in '<'module'>'"
File "C:\Program Files (x86)\PsychoPy2\Lib\site-packages\PsychoPy-1.80.03-py2.7.egg\psychopy\preferences\__init__.py", line 5, in '<'module'>'
File "C:\Program Files (x86)\PsychoPy2\Lib\site-packages\PsychoPy-1.80.03-py2.7.egg\psychopy\preferences\preferences.py", line 186, in '<'module'>'
File "C:\Program Files (x86)\PsychoPy2\Lib\site-packages\PsychoPy-1.80.03-py2.7.egg\psychopy\preferences\preferences.py", line 32, in __init__
File "C:\Program Files (x86)\PsychoPy2\Lib\site-packages\PsychoPy-1.80.03-py2.7.egg\psychopy\preferences\preferences.py", line 95, in getPaths
File "C:\Program Files (x86)\IronPython 2.7\Lib\os.py", line 423, in __getitem__
KeyError: HOME
I was wondering if anyone know how to install thrid party packages in Ironpython.
Upvotes: 1
Views: 289
Reputation: 1223
I'm guessing that you can fix this by adding HOME as an environment variable (System properties>Advanced) and pointing it to your home folder.
I'm not sure why that step is needed for IronPython but not for regular C python - I guess C Python creates it if it isn't found?
I also don't know what else will go wrong in PsychoPy; I've never used IronPython
Jon
Upvotes: 1