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

Unable to download web3 on Mac #1761

Closed
donsmeed opened this issue Oct 5, 2020 · 10 comments
Closed

Unable to download web3 on Mac #1761

donsmeed opened this issue Oct 5, 2020 · 10 comments

Comments

@donsmeed
Copy link

donsmeed commented Oct 5, 2020

Here is the error message I am getting:
Using cached cytoolz-0.11.0.tar.gz (477 kB)
ERROR: Command errored out with exit status 1:
command: /Users/username/anaconda3/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/sf/0ffx9bz14q5dl2xtstpccbxr0000gn/T/pip-install-rzitfoh2/cytoolz/setup.py'"'"'; file='"'"'/private/var/folders/sf/0ffx9bz14q5dl2xtstpccbxr0000gn/T/pip-install-rzitfoh2/cytoolz/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/sf/0ffx9bz14q5dl2xtstpccbxr0000gn/T/pip-pip-egg-info-atyua5lz
cwd: /private/var/folders/sf/0ffx9bz14q5dl2xtstpccbxr0000gn/T/pip-install-rzitfoh2/cytoolz/
Complete output (39 lines):
[1/5] Cythonizing cytoolz/dicttoolz.pyx
[2/5] Cythonizing cytoolz/functoolz.pyx

Error compiling Cython file:
------------------------------------------------------------
...

    def __repr__(self):
        return '{.__class__.__name__}{!r}'.format(
            self, tuple(reversed((self.first, ) + self.funcs)))

    def __eq__(self, other):
   ^
------------------------------------------------------------

cytoolz/functoolz.pyx:518:4: Special method __eq__ must be implemented via __richcmp__

Error compiling Cython file:
------------------------------------------------------------
...
    def __eq__(self, other):
        if isinstance(other, Compose):
            return other.first == self.first and other.funcs == self.funcs
        return NotImplemented

    def __ne__(self, other):
   ^
------------------------------------------------------------

cytoolz/functoolz.pyx:523:4: Special method __ne__ must be implemented via __richcmp__
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/private/var/folders/sf/0ffx9bz14q5dl2xtstpccbxr0000gn/T/pip-install-rzitfoh2/cytoolz/setup.py", line 87, in <module>
    ext_modules = cythonize(ext_modules, force=not is_dev)
  File "/Users/username/anaconda3/lib/python3.6/site-packages/Cython/Build/Dependencies.py", line 1027, in cythonize
    cythonize_one(*args)
  File "/Users/username/anaconda3/lib/python3.6/site-packages/Cython/Build/Dependencies.py", line 1149, in cythonize_one
    raise CompileError(None, pyx_file)
Cython.Compiler.Errors.CompileError: cytoolz/functoolz.pyx
----------------------------------------

ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.### What was wrong?

I am using a Mac 10.14 mojave,
python versionPython 3.6.3 :: Anaconda, Inc.

I have already tried the following:
xcode-select --install
sudo xcode-select --reset
and then attempted to reinstall web3, getting the above error again.
I was able to install ipython no problem. I am wondering if my issue is anaconda being set as my default python? If so how do I fix this. If not, any suggestions?

@kclowes
Copy link
Collaborator

kclowes commented Oct 8, 2020

I'm not quite sure what's going on here. Initially I was thinking that maybe the version of cytoolz might not be compatible with web3, but I was able to install cytoolz==0.11.0 and run web3 with no problem. Does starting over in a new virtual environment solve the problem?

@donsmeed
Copy link
Author

donsmeed commented Oct 9, 2020

Let me try that

@donsmeed
Copy link
Author

donsmeed commented Oct 9, 2020

OK I just spun up a virtual enviroment, upgraded pip and retried downloading web3 by
running pip install web3. In the middle of the below error code it states:
ALERT: Cython not installed. Building without Cython Running setup.py install for cytoolz ... error
I am wondering if not having cython installed is the source of my above problem. I did get one other error message.
At the bottom I got this error:
ERROR: Command errored out with exit status 1: /Users/username/env/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/sf/0ffx9bz14q5dl2xtstpccbxr0000gn/T/pip-install-4yw2xp4_/cytoolz/setup.py'"'"';

Below is the original unedited error message:
ERROR: Command errored out with exit status 1:
command: /Users/username/env/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/sf/0ffx9bz14q5dl2xtstpccbxr0000gn/T/pip-install-4yw2xp4_/cytoolz/setup.py'"'"'; file='"'"'/private/var/folders/sf/0ffx9bz14q5dl2xtstpccbxr0000gn/T/pip-install-4yw2xp4_/cytoolz/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /private/var/folders/sf/0ffx9bz14q5dl2xtstpccbxr0000gn/T/pip-record-ohhdluzd/install-record.txt --single-version-externally-managed --compile --install-headers /Users/username/env/include/site/python3.7/cytoolz
cwd: /private/var/folders/sf/0ffx9bz14q5dl2xtstpccbxr0000gn/T/pip-install-4yw2xp4_/cytoolz/
Complete output (60 lines):
ALERT: Cython not installed. Building without Cython.
running install
running build
running build_py
creating build
creating build/lib.macosx-10.6-intel-3.7
creating build/lib.macosx-10.6-intel-3.7/cytoolz
copying cytoolz/compatibility.py -> build/lib.macosx-10.6-intel-3.7/cytoolz
copying cytoolz/utils_test.py -> build/lib.macosx-10.6-intel-3.7/cytoolz
copying cytoolz/version.py -> build/lib.macosx-10.6-intel-3.7/cytoolz
copying cytoolz/init.py -> build/lib.macosx-10.6-intel-3.7/cytoolz
copying cytoolz/signatures.py -> build/lib.macosx-10.6-intel-3.7/cytoolz
creating build/lib.macosx-10.6-intel-3.7/cytoolz/curried
copying cytoolz/curried/operator.py -> build/lib.macosx-10.6-intel-3.7/cytoolz/curried
copying cytoolz/curried/init.py -> build/lib.macosx-10.6-intel-3.7/cytoolz/curried
copying cytoolz/curried/exceptions.py -> build/lib.macosx-10.6-intel-3.7/cytoolz/curried
copying cytoolz/itertoolz.pyx -> build/lib.macosx-10.6-intel-3.7/cytoolz
copying cytoolz/dicttoolz.pyx -> build/lib.macosx-10.6-intel-3.7/cytoolz
copying cytoolz/functoolz.pyx -> build/lib.macosx-10.6-intel-3.7/cytoolz
copying cytoolz/recipes.pyx -> build/lib.macosx-10.6-intel-3.7/cytoolz
copying cytoolz/utils.pyx -> build/lib.macosx-10.6-intel-3.7/cytoolz
copying cytoolz/utils.pxd -> build/lib.macosx-10.6-intel-3.7/cytoolz
copying cytoolz/init.pxd -> build/lib.macosx-10.6-intel-3.7/cytoolz
copying cytoolz/recipes.pxd -> build/lib.macosx-10.6-intel-3.7/cytoolz
copying cytoolz/functoolz.pxd -> build/lib.macosx-10.6-intel-3.7/cytoolz
copying cytoolz/dicttoolz.pxd -> build/lib.macosx-10.6-intel-3.7/cytoolz
copying cytoolz/cpython.pxd -> build/lib.macosx-10.6-intel-3.7/cytoolz
copying cytoolz/itertoolz.pxd -> build/lib.macosx-10.6-intel-3.7/cytoolz
creating build/lib.macosx-10.6-intel-3.7/cytoolz/tests
copying cytoolz/tests/test_none_safe.py -> build/lib.macosx-10.6-intel-3.7/cytoolz/tests
copying cytoolz/tests/test_utils.py -> build/lib.macosx-10.6-intel-3.7/cytoolz/tests
copying cytoolz/tests/test_curried.py -> build/lib.macosx-10.6-intel-3.7/cytoolz/tests
copying cytoolz/tests/test_compatibility.py -> build/lib.macosx-10.6-intel-3.7/cytoolz/tests
copying cytoolz/tests/test_embedded_sigs.py -> build/lib.macosx-10.6-intel-3.7/cytoolz/tests
copying cytoolz/tests/test_functoolz.py -> build/lib.macosx-10.6-intel-3.7/cytoolz/tests
copying cytoolz/tests/test_inspect_args.py -> build/lib.macosx-10.6-intel-3.7/cytoolz/tests
copying cytoolz/tests/test_doctests.py -> build/lib.macosx-10.6-intel-3.7/cytoolz/tests
copying cytoolz/tests/test_tlz.py -> build/lib.macosx-10.6-intel-3.7/cytoolz/tests
copying cytoolz/tests/test_signatures.py -> build/lib.macosx-10.6-intel-3.7/cytoolz/tests
copying cytoolz/tests/dev_skip_test.py -> build/lib.macosx-10.6-intel-3.7/cytoolz/tests
copying cytoolz/tests/test_recipes.py -> build/lib.macosx-10.6-intel-3.7/cytoolz/tests
copying cytoolz/tests/test_docstrings.py -> build/lib.macosx-10.6-intel-3.7/cytoolz/tests
copying cytoolz/tests/test_dev_skip_test.py -> build/lib.macosx-10.6-intel-3.7/cytoolz/tests
copying cytoolz/tests/test_dicttoolz.py -> build/lib.macosx-10.6-intel-3.7/cytoolz/tests
copying cytoolz/tests/test_serialization.py -> build/lib.macosx-10.6-intel-3.7/cytoolz/tests
copying cytoolz/tests/test_curried_toolzlike.py -> build/lib.macosx-10.6-intel-3.7/cytoolz/tests
copying cytoolz/tests/test_itertoolz.py -> build/lib.macosx-10.6-intel-3.7/cytoolz/tests
running build_ext
building 'cytoolz.dicttoolz' extension
creating build/temp.macosx-10.6-intel-3.7
creating build/temp.macosx-10.6-intel-3.7/cytoolz
gcc -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch i386 -arch x86_64 -g -I/Users/username/env/include -I/Library/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c cytoolz/dicttoolz.c -o build/temp.macosx-10.6-intel-3.7/cytoolz/dicttoolz.o
gcc -bundle -undefined dynamic_lookup -arch i386 -arch x86_64 -g build/temp.macosx-10.6-intel-3.7/cytoolz/dicttoolz.o -o build/lib.macosx-10.6-intel-3.7/cytoolz/dicttoolz.cpython-37m-darwin.so
ld: malformed file
/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/lib/libSystem.tbd:4:18: error: unknown enumerated scalar
platform: zippered
^~~~~~~~
file '/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/lib/libSystem.tbd'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'gcc' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /Users/username/env/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/sf/0ffx9bz14q5dl2xtstpccbxr0000gn/T/pip-install-4yw2xp4
/cytoolz/setup.py'"'"'; file='"'"'/private/var/folders/sf/0ffx9bz14q5dl2xtstpccbxr0000gn/T/pip-install-4yw2xp4
/cytoolz/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /private/var/folders/sf/0ffx9bz14q5dl2xtstpccbxr0000gn/T/pip-record-ohhdluzd/install-record.txt --single-version-externally-managed --compile --install-headers /Users/username/env/include/site/python3.7/cytoolz Check the logs for full command output.

@kclowes
Copy link
Collaborator

kclowes commented Oct 9, 2020

I'm going to look into this a little more because it keeps coming up, but I've had success in the past uninstalling and then reinstalling gcc. I haven't taken the time to figure out the root cause, however. It may be Cython not being installed like you mentioned, but I don't see it installed on my machine, so I don't think that's it. You might try running xcode-select --install again as well to get the latest version of clang. I'll keep digging and let you know if I see anything else, but let me know if you get it figured out in the meantime.

I'd also like to note that I think the solution to this issue deserves being put in the troubleshooting section of the docs.

@kclowes
Copy link
Collaborator

kclowes commented Oct 9, 2020

So I just checked and I am able to replicate the failed install in a fresh env but it's not quite the same problem as yours. It looks like mine is due to the watchdog library, but for whatever reason upgrading pip fixes my issue. I'll keep digging on Monday.

@donsmeed
Copy link
Author

Thank you for you help

@maxwolff
Copy link

also had trouble pip install ing, error building wheel for bitarray, cytoolz, and lru-dict

mac os x 10.15
python 3.8

https://pastebin.com/aDu1zGWk

ended up just bumping down to python 3.7 and got it to work

@nraychaudhuri
Copy link

3.7 worked for me as well. Thanks for the tip @maxwolff

@Kagerrak
Copy link

have the same issue tried everything in here including bumping down to python 3.7 any more alternative solutions?

@fselmo
Copy link
Collaborator

fselmo commented Feb 24, 2022

We have a ticket opened in eth-account to look into these issues and this is a bit older so I'm going to close this in favor of keeping the conversation there: ethereum/eth-account#132

@fselmo fselmo closed this as completed Feb 24, 2022
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

No branches or pull requests

6 participants