question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Pip installation error on Ubuntu

See original GitHub issue

Describe the bug The upgrade to mythril 0.18.10 fails on Ubuntu with the following error:

$ pip3 install mythril -U
Collecting mythril
  Using cached https://files.pythonhosted.org/packages/ac/c4/a258e1472f29e0866d6a82f320df17b69e1b45e552e7c7cf46194a566e70/mythril-0.18.10.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-qa5hgytb/mythril/setup.py", line 15, in <module>
        exec(open(version_path, 'r').read())
    TypeError: invalid file: PosixPath('/tmp/pip-install-qa5hgytb/mythril/mythril/version.py')
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-qa5hgytb/mythril/

Same error when running setup.py manually:

ubuntu:~/myth/mythril-0.18.10$ python setup.py 
Traceback (most recent call last):
  File "setup.py", line 15, in <module>
    exec(open(version_path, 'r').read())
TypeError: invalid file: PosixPath('/home/ubuntu/myth/mythril-0.18.10/mythril/version.py')

The file mentioned in the error message exists & is readable though:

$ cat /home/ubuntu/myth/mythril-0.18.10/mythril/version.py
# This file is suitable for sourcing inside POSIX shell, e.g. bash as
# well as for importing into Python
VERSION="v0.18.10"  # NOQA

On my Mac, it worked without issues.

@rocky, this might have something to do with the latest changes in #351?

Desktop (please complete the following information):

  • OS: Ubuntu 16.04

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:14 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
rockycommented, Jul 23, 2018

Ok. I see what’s up. I bet you ran this on Python version 3.5.x (or more precisely < Python 3.6) where open() doesn’t accept a Path type.

One simple fix is to change:

exec(open(version_path, 'r').read())

to:

exec(open(str(version_path), 'r').read())

but perhaps this error has some blessings in disguise. (Or at least I hope you take it that way 😃 )

Previously when I was checking to see if this worked for Pypy, I recall reading that Mythril needs 3.6 or later. Is 3.5 acceptable?

Our setup.py suggest yes here.

However it also says here that Python 2x, 2.7, 3x, 3, and 3.4 are allowed in addition. And no mention of 3.6 or 3.7.

So which versions do we support?

After understanding that, I would be happy to correct all of the parts of setup.py to make them consistent in the next fix.

Thanks.

0reactions
JoranHonigcommented, Aug 13, 2018

Closing this as the original issue seems to be fixed. Thanks @johnbender for confirming. Not sure if the mac os thing has been solved, if not feel free to open another issue 😄

@JonHaas Thanks for the info! 👍 Hope that helped with @stuardo3191’s issue. We’re planning on supporting 3.7 as well in the future

Read more comments on GitHub >

github_iconTop Results From Across the Web

pip install error - python
You are installing pip with sudo but its using your user's home folder's python staging area. This can cause issues later on where...
Read more >
[Solved] pip command not found Ubuntu 20.04
The pip command is not found an error raised on your Linux terminal window if the pip is not installed independently on Ubuntu...
Read more >
pip not working on ubuntu 18, how to fix that?
When I ran the pip command first, I got error as pip command not found. So, installed it using sudo apt install python-pip....
Read more >
Unable to install pip in ubuntu?
Try with this commands: sudo apt-get purge --auto-remove python-pip sudo apt-get update sudo apt-get -y install python-pip curl ...
Read more >
pip install on latest ubuntu fails with error · Issue #398
Description: github actions for python 3.8 fails with the following error: ERROR: Invalid requirement: 'Warning: The lock flag' (from line 2 ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found