ZeroNet icon indicating copy to clipboard operation
ZeroNet copied to clipboard

OSX El Capitan: zeronet.py fails on import gevent

Open jarlarntzen opened this issue 10 years ago • 20 comments

Hi, I followed the instructions for mac but it fails when attempting to run gevent. Anyone got a suggestion?

MacBook-Pro:ZeroNet-master jarla$ python zeronet.py
- Starting ZeroNet...
Traceback (most recent call last):
  File "zeronet.py", line 15, in main
    import main
  File "src/main.py", line 8, in <module>
    import gevent
ImportError: No module named gevent
Traceback (most recent call last):
  File "zeronet.py", line 60, in <module>
    main()
  File "zeronet.py", line 46, in main
    traceback.print_exc(file=open("log/error.log", "a"))
IOError: [Errno 2] No such file or directory: 'log/error.log'

jarlarntzen avatar Mar 02 '16 13:03 jarlarntzen

Were you at least able to get gevent installed through pip? Also do you have System Integrity Protection disabled?

ASBaumgarten avatar Mar 02 '16 13:03 ASBaumgarten

Thanks for your prompt response! Gevent seems to have installed nicely. Thanks. Not sure what the System Integrity Protection is but I'll look it up. (There wasn't any information about SIP at the download page.)

$ pip install gevent msgpack-python
Requirement already satisfied (use --upgrade to upgrade): gevent in /usr/local/lib/python2.7/site-packages
Requirement already satisfied (use --upgrade to upgrade): msgpack-python in /usr/local/lib/python2.7/site-packages
Requirement already satisfied (use --upgrade to upgrade): greenlet>=0.4.7 in /usr/local/lib/python2.7/site-packages (from gevent)

jarlarntzen avatar Mar 02 '16 15:03 jarlarntzen

My SIP isn't disabled and from the description here it seems I need to switch if off completely. Which is a little much just to run ZeroNet. Think I'm going to try this on my Ubuntu 14.04 home machine instead.

jarlarntzen avatar Mar 02 '16 15:03 jarlarntzen

please try python -m pip install gevent msgpack-python, maybe the pip command uses different python installation

I have no osx access, so it would be nice if someone could create a easier installation method for mac. Maybe similar to zerobundle for windows where everything is packed up in a zip file, all you need to download, unpack and run zeronet.cmd.

HelloZeroNet avatar Mar 02 '16 16:03 HelloZeroNet

@HelloZeroNet it works, thank you

xtazz avatar Mar 02 '16 16:03 xtazz

Apple implemented SIP in OSX 10.11 to help lock down a lot of stuff in the system folders like /usr http://totalfinder.binaryage.com/system-integrity-protection

ASBaumgarten avatar Mar 02 '16 17:03 ASBaumgarten

@HelloZeroNet If cross platform testing is an issue, one potential solution could be to just release ZeroNet in Docker containers, similar to what nofish has made. It would eliminate the strenuous need to test each build on Windows, OSX, and Linux. The only real drawback would be that individuals would need to learn and setup Docker, but that complication is almost perfectly remedied with Kitematic.

ASBaumgarten avatar Mar 02 '16 18:03 ASBaumgarten

Same problem here. @HelloZeroNet suggestion didn't work. Any other suggestion? Thanks

victorBaro avatar Mar 03 '16 03:03 victorBaro

Thanks, @HelloZeroNet . The command wasn't well received on OSX El Capitan v10.11.3, though:

$ python -m pip install gevent msgpack-python
/usr/bin/python: No module named pip

It did work very, very nicely on Ubuntu 14.04 LTS :)

jarlarntzen avatar Mar 03 '16 08:03 jarlarntzen

@jarlarntzen Unless you installed Python using Homebrew, you will have install pip manually from here https://pip.pypa.io/en/stable/installing/. Once you have pip downloaded and installed you will be able to run python -m pip install gevent msgpack-python.

ASBaumgarten avatar Mar 03 '16 16:03 ASBaumgarten

OS X 10.11.3, SIP disabled, additional installation of python in /usr/local, pip-installed gevent & msgpack-python (without the -m option), updated all pip-installed formulas, added zeronet, no problems. Works great (Safari 9.0.3). Also works fine with VPN (OpenVPN via built-in utun.)

JayBrown avatar Mar 03 '16 21:03 JayBrown

I think i was able to create a bundle for mac, please help me verify it's working: https://github.com/HelloZeroNet/ZeroBundle/releases/download/0.1.1/ZeroBundle-mac-v0.1.1.zip

  • (Close ZeroNet if already running for you)
  • Download, unpack, run ZeroNet(.app)

It should download the latest version from github, start it and open ZeroHello in the browser.

Please also check http://127.0.0.1:43110/Benchmark if everything is ok. (no errors, openssl verify is working, the python version should be 2.7.11)

Thanks!

HelloZeroNet avatar Mar 05 '16 02:03 HelloZeroNet

Wow! This works fantastically well!

Thanks @HelloZeroNet

Benchmarking ZeroNet 0.3.6 (rev949) Python 2.7.11 |Anaconda 2.5.0 (x86_64)| (default, Dec 6 2015, 18:57:58) [GCC 4.2.1 (Apple Inc. build 5577)] on: darwin...

CryptBitcoin:
- hdPrivatekey x 10..........0.127s [x5.52: Insane!!]
- sign x 10..........0.066s [x5.34: Insane!!]
- openssl verify x 100..........0.136s [x2.72: WOW]
- pure-python verify x 10..........0.328s [x4.88: Insane!!]

CryptHash:
- sha256 5M x 10..........0.152s [x3.95: Insane!!]
- sha512 5M x 10..........0.110s [x5.44: Insane!!]
- os.urandom(256) x 100 000..........2.067s [x0.31: Ehh]

Msgpack:
- pack 5K x 10 000..........0.258s [x3.02: WOW]
- unpack 5K x 10 000..........0.473s [x2.54: WOW]
- streaming unpack 5K x 10 000..........0.495s [x2.83: WOW]

Db:
- Open x 10..........0.019s [x6.91: Insane!!]
- Insert x 10 x 1000..........0.394s [x2.54: WOW]
- Buffered insert x 100 x 100..........0.770s [x1.69: Fine]
- Total rows in db: 20000
- Indexed query x 1000..........0.116s [x2.16: Fast]
- Not indexed query x 100..........0.409s [x1.47: Fine]
- Like query x 100..........0.796s [x2.26: Fast]

Done. Total: 8.65s

jarlarntzen avatar Mar 07 '16 08:03 jarlarntzen

@HelloZeroNet I'd like to argue that this should be the default download for OSX. :+1: Thanks!

jarlarntzen avatar Mar 07 '16 10:03 jarlarntzen

https://zeronet.io/ should offer this method by default now.

HelloZeroNet avatar Mar 07 '16 10:03 HelloZeroNet

Fantastic! Thanks! :smile:

jarlarntzen avatar Mar 08 '16 07:03 jarlarntzen

https://github.com/HelloZeroNet/ZeroBundle/releases/download/0.1.1/ZeroBundle-mac-v0.1.1.zip

(Close ZeroNet if already running for you) Download, unpack, run ZeroNet(.app)

run successful ,but how to exit ZeroNet ?

preswang avatar Apr 29 '16 13:04 preswang

From ZeroNet's web GUI, right?

JayBrown avatar Apr 29 '16 15:04 JayBrown

use the ... menu on ZeroHello

HelloZeroNet avatar Apr 29 '16 16:04 HelloZeroNet

@HelloZeroNet Use ZeroBundle-mac-v0.1.1.zip , It works! thanks~

a1thwn avatar Sep 28 '16 14:09 a1thwn