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

importing erlport in Python3 yields syntax error #42

Open
vtsatskin opened this Issue May 17, 2017 · 4 comments

Comments

Projects
None yet
4 participants
@vtsatskin

vtsatskin commented May 17, 2017

> pip3 install erlport
Collecting erlport
Installing collected packages: erlport
Successfully installed erlport-0.6
> python3
Python 3.5.2 (default, Nov 25 2016, 16:29:04) 
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import erlport
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.5/site-packages/erlport/__init__.py", line 33, in <module>
    from erlport.erlproto import Port, Protocol
  File "/usr/local/lib/python3.5/site-packages/erlport/erlproto.py", line 107
    except IOError, why:
                  ^
SyntaxError: invalid syntax

I noticed the current version of erlport is 0.9.8 but the one listed on pypi is 0.6. Is this correct? If not, can the python package on pypi be updated?

Tangentially, how does one go about installing the erlport python library from the source code?

@puruzio

This comment has been minimized.

Show comment
Hide comment
@puruzio

puruzio Jul 5, 2017

In case this helps, I saw a closed issue that recommends removing erlport from pip, and relying on erlport loading the python module at runtime (#32).

In my case, following that advice removed the syntax error you referenced, but caused a different error "no module named erlport.cli" instead. The fix was to copy the erlport folder (which includes cli.py) from \erlport-0.9.8\priv\python3\ to \Anaconda3\Lib\site-packages.

puruzio commented Jul 5, 2017

In case this helps, I saw a closed issue that recommends removing erlport from pip, and relying on erlport loading the python module at runtime (#32).

In my case, following that advice removed the syntax error you referenced, but caused a different error "no module named erlport.cli" instead. The fix was to copy the erlport folder (which includes cli.py) from \erlport-0.9.8\priv\python3\ to \Anaconda3\Lib\site-packages.

@amarandon

This comment has been minimized.

Show comment
Hide comment
@amarandon

amarandon Oct 11, 2017

@puruzio Apparently cli.py has been removed from https://github.com/hdima/erlport/tree/master/priv/python3/erlport so I can't see how I can get around this issue now.

amarandon commented Oct 11, 2017

@puruzio Apparently cli.py has been removed from https://github.com/hdima/erlport/tree/master/priv/python3/erlport so I can't see how I can get around this issue now.

@filmor

This comment has been minimized.

Show comment
Hide comment
@filmor

filmor Oct 11, 2017

You have to first copy the contents of python2 and after that copy the contents of python3 on top. Not all files have an explicit Python 3 version.

filmor commented Oct 11, 2017

You have to first copy the contents of python2 and after that copy the contents of python3 on top. Not all files have an explicit Python 3 version.

@amarandon

This comment has been minimized.

Show comment
Hide comment
@amarandon

amarandon Oct 12, 2017

@filmor Thanks a lot it works!

It seems that this should be part of the install process, shouldn't it?

amarandon commented Oct 12, 2017

@filmor Thanks a lot it works!

It seems that this should be part of the install process, shouldn't it?

amarandon pushed a commit to weatherforce/erlport that referenced this issue Feb 1, 2018

amarandon pushed a commit to weatherforce/erlport that referenced this issue Feb 1, 2018

@amarandon amarandon referenced a pull request that will close this issue Feb 1, 2018

Open

Fix syntax error with Python 3 #44

GlenWalker added a commit to GlenWalker/erlport that referenced this issue Aug 22, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment