首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >导入pyexcel-xlxs时出错

导入pyexcel-xlxs时出错
EN

Stack Overflow用户
提问于 2017-04-07 14:04:38
回答 2查看 413关注 0票数 0

你好,我正在为我的web应用程序使用pythonanywhere.com,我找到了一种导入pyexcel的方法供我使用,但似乎我做不到,因为这个错误。我是网络应用开发的新手。所以拜托了。我需要你的帮助。

当我通过从github克隆它来安装它时,它做了以下工作:

代码语言:javascript
复制
    $ git clone http://github.com/pyexcel/pyexcel-xlsx.git
    $ cd pyexcel-xlsx
    $ python setup.py install

但我有个错误:

代码语言:javascript
复制
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.
EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2017-04-07 14:15:53

因为您使用的是PythonAnywhere的标准Python,而不是构建虚拟环境(在您的控制下),所以setup.py试图安装到系统site-packages目录中,在那里您只有读取权限。如果您想继续不使用虚拟环境,那么在您自己的区域中创建一个目录,并告诉setup.py使用--install-lib dirname选项在那里安装它。

然后,使用PYTHONPATHexport PYTHONPATH=dirname shell环境变量设置为该目录,以便解释器将该目录添加到其模块搜索路径中,您应该可以继续。

票数 1
EN

Stack Overflow用户

发布于 2017-04-08 19:42:43

@holdenweb的说明很好,但是一个更快的方法就是在bash控制台中运行它:

代码语言:javascript
复制
pip2.7 install --user https://github.com/pyexcel/pyexcel-xlsx/archive/master.zip
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/43280150

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档