Closed desireYY closed 5 years ago
It looks like you don't have the permission to write to the Python's site-package:
Permission denied: '/Library/Python/2.7/site-packages/easy-install.pth'
A good practice is to setup a virtual environment. Alternatively run the installation as superuser - by using sudo for example.
看起来您没有写入 Python 的 site-package 的权限:
权限被拒绝:'/ Library /Python/2.7/site-packages/easy-install.pth'
一个好的做法是设置虚拟环境。或者以超级用户身份运行安装 - 例如使用 sudo。
i use sudo ,but still can't setup
` desires-MacBook-Pro:~ desire$ cd /Users/desire/Downloads/zbarlight-master\ 2 desires-MacBook-Pro:zbarlight-master 2 desire$ ls Changelog.rst docs src LICENSE requirements-dev.txt tests MANIFEST.in run.py tox.ini Makefile setup.cfg README.rst setup.py desires-MacBook-Pro:zbarlight-master 2 desire$ sudo python setup.py install Password: /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/extension.py:133: UserWarning: Unknown Extension options: 'optional' warnings.warn(msg) /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'long_description_content_type' warnings.warn(msg) /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'project_urls' warnings.warn(msg) /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'python_requires' warnings.warn(msg)
Installed /Users/desire/Downloads/zbarlight-master 2/.eggs/setuptools-40.4.1-py2.7.egg
running install
Checking .pth file support in /Library/Python/2.7/site-packages/
/usr/bin/python -E -c pass
TEST PASSED: /Library/Python/2.7/site-packages/ appears to support .pth files
running bdist_egg
running egg_info
creating src/UNKNOWN.egg-info
writing src/UNKNOWN.egg-info/PKG-INFO
writing top-level names to src/UNKNOWN.egg-info/top_level.txt
writing dependency_links to src/UNKNOWN.egg-info/dependency_links.txt
writing manifest file 'src/UNKNOWN.egg-info/SOURCES.txt'
reading manifest file 'src/UNKNOWN.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
no previously-included directories found matching 'docs'
no previously-included directories found matching 'tests'
warning: no previously-included files matching '.py[cod]' found anywhere in distribution
warning: no previously-included files matching 'pycache' found anywhere in distribution
warning: no previously-included files matching '.so' found anywhere in distribution
warning: no previously-included files found matching 'Makefile'
warning: no previously-included files found matching 'requirements-dev.txt'
warning: no previously-included files found matching 'tox.ini'
warning: no previously-included files found matching 'run.py'
writing manifest file 'src/UNKNOWN.egg-info/SOURCES.txt'
installing library code to build/bdist.macosx-10.13-intel/egg
running install_lib
running build_ext
building 'zbarlight._zbarlight' extension
creating build
creating build/temp.macosx-10.13-intel-2.7
creating build/temp.macosx-10.13-intel-2.7/src
creating build/temp.macosx-10.13-intel-2.7/src/zbarlight
cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64 -pipe -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/zbarlight/_zbarlight.c -o build/temp.macosx-10.13-intel-2.7/src/zbarlight/_zbarlight.o -std=c99
src/zbarlight/_zbarlight.c:82:26: warning: implicit conversion loses integer
precision: 'Py_ssize_t' (aka 'long') to 'int' [-Wshorten-64-to-32]
symbologies.number = PyList_Size(python_symbologies);
~ ^~~~~~~
src/zbarlight/_zbarlight.c:85:37: warning: implicit conversion loses integer
precision: 'long' to 'int' [-Wshorten-64-to-32]
symbologies.symbologie[i] = PyLong_AsLong(obj);
~ ^~~~~~
2 warnings generated.
creating build/lib.macosx-10.13-intel-2.7
creating build/lib.macosx-10.13-intel-2.7/zbarlight
cc -bundle -undefined dynamic_lookup -arch x86_64 -arch i386 -Wl,-F. build/temp.macosx-10.13-intel-2.7/src/zbarlight/_zbarlight.o -lzbar -o build/lib.macosx-10.13-intel-2.7/zbarlight/_zbarlight.so
ld: warning: ignoring file /usr/local/lib/libzbar.dylib, file was built for x86_64 which is not the architecture being linked (i386): /usr/local/lib/libzbar.dylib
creating build/bdist.macosx-10.13-intel
creating build/bdist.macosx-10.13-intel/egg
creating build/bdist.macosx-10.13-intel/egg/zbarlight
copying build/lib.macosx-10.13-intel-2.7/zbarlight/_zbarlight.so -> build/bdist.macosx-10.13-intel/egg/zbarlight
creating stub loader for zbarlight/_zbarlight.so
byte-compiling build/bdist.macosx-10.13-intel/egg/zbarlight/_zbarlight.py to _zbarlight.pyc
creating build/bdist.macosx-10.13-intel/egg/EGG-INFO
copying src/UNKNOWN.egg-info/PKG-INFO -> build/bdist.macosx-10.13-intel/egg/EGG-INFO
copying src/UNKNOWN.egg-info/SOURCES.txt -> build/bdist.macosx-10.13-intel/egg/EGG-INFO
copying src/UNKNOWN.egg-info/dependency_links.txt -> build/bdist.macosx-10.13-intel/egg/EGG-INFO
copying src/UNKNOWN.egg-info/top_level.txt -> build/bdist.macosx-10.13-intel/egg/EGG-INFO
writing build/bdist.macosx-10.13-intel/egg/EGG-INFO/native_libs.txt
zip_safe flag not set; analyzing archive contents...
creating dist
creating 'dist/UNKNOWN-0.0.0-py2.7-macosx-10.13-intel.egg' and adding 'build/bdist.macosx-10.13-intel/egg' to it
removing 'build/bdist.macosx-10.13-intel/egg' (and everything under it)
Processing UNKNOWN-0.0.0-py2.7-macosx-10.13-intel.egg
Removing /Library/Python/2.7/site-packages/UNKNOWN-0.0.0-py2.7-macosx-10.13-intel.egg
Copying UNKNOWN-0.0.0-py2.7-macosx-10.13-intel.egg to /Library/Python/2.7/site-packages
UNKNOWN 0.0.0 is already the active version in easy-install.pth
Installed /Library/Python/2.7/site-packages/UNKNOWN-0.0.0-py2.7-macosx-10.13-intel.egg Processing dependencies for UNKNOWN==0.0.0 Finished processing dependencies for UNKNOWN==0.0.0 desires-MacBook-Pro:zbarlight-master 2 desire$ python Python 2.7.10 (default, Oct 6 2017, 22:29:07) [GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.31)] on darwin Type "help", "copyright", "credits" or "license" for more information.
import zbarlight Traceback (most recent call last): File "
", line 1, in ImportError: No module named zbarlight `
when i use pip steup, still fail
It seem to be a similar issue that https://github.com/Polyconseil/zbarlight/issues/21. In your logs, we see that package zbarlight produced metadata for project name unknwon
which is a sign that our setuptools version is too old (zbarligth is only compatible with setuptools 30.3+).
I close this problem as a duplicate of # 21. Be free to reopen it if it is not the case.