你好,我正在为我的web应用程序使用pythonanywhere.com,我找到了一种导入pyexcel的方法供我使用,但似乎我做不到,因为这个错误。我是网络应用开发的新手。所以拜托了。我需要你的帮助。
当我通过从github克隆它来安装它时,它做了以下工作:
$ git clone http://github.com/pyexcel/pyexcel-xlsx.git
$ cd pyexcel-xlsx
$ python setup.py install但我有个错误:
13:56 ~ $ git clone http://github.com/pyexcel/pyexcel-xlsx.git
Cloning into 'pyexcel-xlsx'...
remote: Counting objects: 808, done.
remote: Compressing objects: 100% (7/7), done.
remote: Total 808 (delta 1), reused 0 (delta 0), pack-reused 801
Receiving objects: 100% (808/808), 167.27 KiB | 0 bytes/s, done.
Resolving deltas: 100% (473/473), done.
Checking connectivity... done.
13:56 ~ $ cd pyexcel-xlsx
13:57 ~/pyexcel-xlsx (master)$ python setup.py install
running install
error: can't create or remove files in install directory
The following error occurred while trying to add or remove files in the
installation directory:
[Errno 13] Permission denied: '/usr/local/lib/python2.7/dist-packages/test-easy-install-22208.write-test'
The installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:
/usr/local/lib/python2.7/dist-packages/
Perhaps your account does not have write access to this directory? If the
installation directory is a system-owned directory, you may need to sign in
as the administrator or "root" account. If you do not have administrative
access to this machine, you may wish to choose a different installation
directory, preferably one that is listed in your PYTHONPATH environment
variable.
For information on other options, you may wish to consult the
documentation at:
https://setuptools.readthedocs.io/en/latest/easy_install.html
Please make the appropriate changes for your system and try again.发布于 2017-04-07 14:15:53
因为您使用的是PythonAnywhere的标准Python,而不是构建虚拟环境(在您的控制下),所以setup.py试图安装到系统site-packages目录中,在那里您只有读取权限。如果您想继续不使用虚拟环境,那么在您自己的区域中创建一个目录,并告诉setup.py使用--install-lib dirname选项在那里安装它。
然后,使用PYTHONPATH将export PYTHONPATH=dirname shell环境变量设置为该目录,以便解释器将该目录添加到其模块搜索路径中,您应该可以继续。
发布于 2017-04-08 19:42:43
@holdenweb的说明很好,但是一个更快的方法就是在bash控制台中运行它:
pip2.7 install --user https://github.com/pyexcel/pyexcel-xlsx/archive/master.ziphttps://stackoverflow.com/questions/43280150
复制相似问题