-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cannot use python in lua #41
Comments
Most likely, your |
what should we do? |
Two things come to mind, you can either move the
|
thanks i'll check |
Hallo! I set LUA_CPATH as I see libs copied to site-packages Weee new issue:) What does it mean? Is "lua-python.so" the right lib to use in lua scripts? Why it is installed in python2.7/site-packages ? Thanks in advance! |
My .so files had much longer names. I ended up running into the same issue as you, @surfindominator . @greatwolf , is there something we're getting wrong? I'd be happy to work with you to figure this out so we can get everyone an answer. |
FYI, I'm using Python 3.5 on Ubuntu, with virtualenv. I'm curious what environments the other folks having this issue are using. Maybe there is a commonality? |
What's the name of the lunatic .so built? What's the full path of its location? Also what version of lua/luajit is being used? Note that lua C modules are sensitive to how the shared library is named. Specifically, the name of the |
I'm using Lua 5.2.4. It builds two .so files:
I tried renaming each of them to python.so, and got the same error as @surfindominator for each file. I'm not sure how to go about renaming the entry function, but it looks like it's getting past that point considering the error message -- or maybe I'm misunderstanding. |
@greatwolf, I looked a little closer and realized the message is not identical. It's failing to resolve |
I think I found a bug in the setup.py script. In def pkgconfig(*packages):
# map pkg-config output to kwargs for distutils.core.Extension
flag_map = {'-I': 'include_dirs', '-L': 'library_dirs', '-l': 'libraries'}
combined_pcoutput = ''
for package in packages:
(pcstatus, pcoutput) = commands.getstatusoutput(
"pkg-config --libs --cflags %s" % package)
if pcstatus == 0:
combined_pcoutput += ' ' + pcoutput
else:
sys.exit("pkg-config failed for %s; "
"most recent output was:\n%s" %
(", ".join(packages), pcoutput))
kwargs = {}
for token in combined_pcoutput.split():
if token[:2] in flag_map:
kwargs.setdefault(flag_map.get(token[:2]), []).append(token[2:])
else: # throw others to extra_link_args
kwargs.setdefault('extra_link_args', []).append(token)
if PY3:
items = kwargs.items()
else:
items = kwargs.iteritems()
for k, v in items: # remove duplicated
kwargs[k] = list(set(v))
return kwargs After making this change, and renaming the .so files to lua.so and lua-python.so according to the filename prefixes, I was able to get past the |
I submitted a pull request for the bug fix. This should resolve the linking issues. The .so naming issues are still outstanding. |
I'm running into a new issue now. After |
I'm also getting warnings that |
I submitted another pull request for the |
@greatwolf, it seems that @hosford42 is actively helping in developing lunatic-python. Would you like to have him added as a collaborator? |
@bastibe Sure thing, it would be nice to have multiple maintainers ;) |
Well then, @hosford42, welcome to the team! This comes with no obligations at all, but I am not the author of this package either. Think of it as a "community wiki" post on StackOverflow. |
Thanks, guys! Not sure how much I can help, but happy to when I can.
…On 10/07/2017 09:33 AM, Bastian Bechtold wrote:
Well then, @hosford42 <https://github.com/hosford42>, welcome to the team!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#41 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AEWls6JhisL8L_lcXpDQNrIq7ALN6p6Gks5sp4uzgaJpZM4J1uoH>.
|
cp ./build/lib.linux-x86_64-2.7/lua-python.so ./test/python.so |
i use a raspberry pi 2 and 3
if i do
py = require 'python'
this is what i get
any help
The text was updated successfully, but these errors were encountered: