halostatue-archive / rubypython

An in-process between Ruby and Python 2.
Other
254 stars 47 forks source link

An invalid interpreter was specified. #28

Closed Pistorius closed 7 years ago

Pistorius commented 7 years ago

I installed correctly rubypython in my ruby project on Windows 7 Profesional. When i try to run RubyPython.start i get RubyPython::InvalidInterpreter: An invalid interpreter was specified. Some advise here?

peter-wangxu commented 7 years ago

any trace?

peter-wangxu commented 7 years ago

ignore my previous commemt is the python in you path? or you can try specify the full path for rubypython.start

Pistorius commented 7 years ago

This is my PATH C:\Users\prodriguezl\AppData\Local\Programs\Python\Launcher\;C:\RailsInstaller\Git\cmd;C:\RailsInstaller\Ruby2.3.0\bin

peter-wangxu commented 7 years ago

did you try full path of python.exe?

Pistorius commented 7 years ago

Sry about my poor experience but, how it would be?

peter-wangxu commented 7 years ago

That depends where you installed your python, take my windows as example, the full path of python.exe is C:\Python27\python.exe

Pistorius commented 7 years ago

Ok, i tried with the full path of python.exe: C:\Users\prodriguezl\AppData\Local\Programs\Python\Python36-32\python.exe And the result is the same

peter-wangxu commented 7 years ago

Can you paste you code here?

Pistorius commented 7 years ago

There's not much code to show. I want to use a few lines of python to open and save a .xlsx file after to edit it with other gem. All of this in a ruby class. I'll use this:

...some ruby code...

RubyPython.start
  openpyxl = RubyPython.import "openpyxl"
  wb = openpyxl.load_workbook('my_path')
  wb.save('my_path')
RubyPython.stop

... more ruby code...

I dont know what else I can add here to help with my Issue. I installed python-3.6.2 wich is located in the path mentioned before in my Windows 7 Proffesional 64 bits. And my Gemfile.rb got gem 'rubypython', '~> 0.6.3'

peter-wangxu commented 7 years ago

changing RubyPython.start to RubyPython.start(:python_exe => "C:\\Users\\prodriguezl\\AppData\\Local\\Programs\\Python\\Python36-32\\python.exe") would probably work for working around the current exception.

But I am afford that currently support for python 3 is still in progress.

Thanks Peter

Pistorius commented 7 years ago

Thanks a lot @peter-wangxu, but im still getting the same error. I'll try installing python 2.

Pistorius commented 7 years ago

I installed Python 2.7.13 and i have the same result after try every step mentioned before.

peter-wangxu commented 7 years ago

try to resolve issue from python side...

are you able to enter python console? try to install python in the same path as mine.

Pistorius commented 7 years ago

Hi @peter-wangxu, Im able to use python console and its installed in C:\Python27 as you want :) What i should to do here? Thanks a lot again for your amability

Pistorius commented 7 years ago

I solve this, thank for the help :) Finally I installed the libraries jdcal and at_xmlfile manually in python and then all works fine.

peter-wangxu commented 7 years ago

@Pistorius Awesome!

I did not know of the jdcal and at_xmlfile, can you elaborate it here? that may help others with same environment as you.

Third party libraries should not cause the exception you mentioned in this issue I thought.

Pistorius commented 7 years ago

Sure! I thought the same as you, Im not sure why this solved with that. Anyway, when i tried to import openpyxl with from openpyxl import load_workbook (or load Workbook) in python console it said I need jdcal and et_xmfile so I just download manually both libraries; jdcal and et_xmlfile (its was 'et', not 'at' as I mencioned before, my apologies). That is because as I read openpyxl depends upon them. I extracted the files into C:\Python27\Lib and when I did the same import all works fine :). Finally in ruby i can now do RubyPython.start :D

peter-wangxu commented 7 years ago

GOOD, enjoy the rubypython. I am closing this issue.

Thanks Peter

aimak commented 5 years ago

For other people like me that are looking for this as well. I add to install libpython : sudo apt-get install libpython2.7