Skip to content
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 · May be fixed by #52
Open

importing erlport in Python3 yields syntax error #42

vtsatskin opened this issue May 17, 2017 · 4 comments · May be fixed by #52

Comments

@vtsatskin
Copy link

> 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
Copy link

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.

@ghost
Copy link

ghost 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
Copy link

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.

@ghost
Copy link

ghost commented Oct 12, 2017

@filmor Thanks a lot it works!

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

ghost pushed a commit to weatherforce/erlport that referenced this issue Feb 1, 2018
ghost pushed a commit to weatherforce/erlport that referenced this issue Feb 1, 2018
GlenWalker pushed a commit to GlenWalker/erlport that referenced this issue Aug 22, 2018
peccu added a commit to peccu/erlport that referenced this issue Dec 20, 2018
fixes hdima#42
Makefile makes symlinks for python3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants