我想安装 python-pyofss

我想安装 python-pyofss

我尝试按照说明在 python 上安装 pyofss,但出现以下错误

zeglam@zeglam-Latitude-E6410:~$ pip install pyofss
Downloading/unpacking pyofss
  Downloading pyofss-0.9.tar.gz (69kB): 69kB downloaded
  Running setup.py (path:/tmp/pip_build_zeglam/pyofss/setup.py) egg_info for package pyofss

Requirement already satisfied (use --upgrade to upgrade): numpy>=1.6.2 in /usr/lib/python2.7/dist-packages (from pyofss)
Requirement already satisfied (use --upgrade to upgrade): scipy>=0.10.1 in /usr/lib/python2.7/dist-packages (from pyofss)
Requirement already satisfied (use --upgrade to upgrade): matplotlib>=1.1.0 in /usr/lib/pymodules/python2.7 (from pyofss)
Requirement already satisfied (use --upgrade to upgrade): python-dateutil in /usr/lib/python2.7/dist-packages (from matplotlib>=1.1.0->pyofss)
Downloading/unpacking tornado (from matplotlib>=1.1.0->pyofss)
  Downloading tornado-4.3.tar.gz (450kB): 450kB downloaded
  Running setup.py (path:/tmp/pip_build_zeglam/tornado/setup.py) egg_info for package tornado

    no previously-included directories found matching 'docs/build'
    warning: no files found matching 'tornado/test/README'
Requirement already satisfied (use --upgrade to upgrade): pyparsing>=1.5.6 in /usr/lib/python2.7/dist-packages (from matplotlib>=1.1.0->pyofss)
Downloading/unpacking nose (from matplotlib>=1.1.0->pyofss)
  Downloading nose-1.3.7-py2-none-any.whl (154kB): 154kB downloaded
Downloading/unpacking backports.ssl-match-hostname (from tornado->matplotlib>=1.1.0->pyofss)
  Downloading backports.ssl_match_hostname-3.4.0.2.tar.gz
  Running setup.py (path:/tmp/pip_build_zeglam/backports.ssl-match-hostname/setup.py) egg_info for package backports.ssl-match-hostname

Downloading/unpacking singledispatch (from tornado->matplotlib>=1.1.0->pyofss)
  Downloading singledispatch-3.4.0.3-py2.py3-none-any.whl
Downloading/unpacking certifi (from tornado->matplotlib>=1.1.0->pyofss)
  Downloading certifi-2015.9.6.2-py2.py3-none-any.whl (371kB): 371kB downloaded
Downloading/unpacking backports-abc>=0.4 (from tornado->matplotlib>=1.1.0->pyofss)
  Downloading backports_abc-0.4-py2.py3-none-any.whl
Requirement already satisfied (use --upgrade to upgrade): six in /usr/local/lib/python2.7/dist-packages (from singledispatch->tornado->matplotlib>=1.1.0->pyofss)
Installing collected packages: pyofss, tornado, nose, backports.ssl-match-hostname, singledispatch, certifi, backports-abc
  Running setup.py install for pyofss

    error: could not create '/usr/local/lib/python2.7/dist-packages/pyofss': Permission denied
    Complete output from command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip_build_zeglam/pyofss/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-eK437w-record/install-record.txt --single-version-externally-managed --compile:
    running install

running build

running build_py

creating build

creating build/lib.linux-x86_64-2.7

creating build/lib.linux-x86_64-2.7/pyofss

copying pyofss/system.py -> build/lib.linux-x86_64-2.7/pyofss

copying pyofss/metrics.py -> build/lib.linux-x86_64-2.7/pyofss

copying pyofss/domain.py -> build/lib.linux-x86_64-2.7/pyofss

copying pyofss/field.py -> build/lib.linux-x86_64-2.7/pyofss

copying pyofss/__init__.py -> build/lib.linux-x86_64-2.7/pyofss

creating build/lib.linux-x86_64-2.7/pyofss/modules

copying pyofss/modules/cw.py -> build/lib.linux-x86_64-2.7/pyofss/modules

copying pyofss/modules/gaussian.py -> build/lib.linux-x86_64-2.7/pyofss/modules

copying pyofss/modules/stepper.py -> build/lib.linux-x86_64-2.7/pyofss/modules

copying pyofss/modules/nonlinearity.py -> build/lib.linux-x86_64-2.7/pyofss/modules

copying pyofss/modules/plotter.py -> build/lib.linux-x86_64-2.7/pyofss/modules

copying pyofss/modules/sech.py -> build/lib.linux-x86_64-2.7/pyofss/modules

copying pyofss/modules/fibre.py -> build/lib.linux-x86_64-2.7/pyofss/modules

copying pyofss/modules/bit.py -> build/lib.linux-x86_64-2.7/pyofss/modules

copying pyofss/modules/storage.py -> build/lib.linux-x86_64-2.7/pyofss/modules

copying pyofss/modules/solver.py -> build/lib.linux-x86_64-2.7/pyofss/modules

copying pyofss/modules/filter.py -> build/lib.linux-x86_64-2.7/pyofss/modules

copying pyofss/modules/amplifier.py -> build/lib.linux-x86_64-2.7/pyofss/modules

copying pyofss/modules/__init__.py -> build/lib.linux-x86_64-2.7/pyofss/modules

copying pyofss/modules/generator.py -> build/lib.linux-x86_64-2.7/pyofss/modules

copying pyofss/modules/linearity.py -> build/lib.linux-x86_64-2.7/pyofss/modules

creating build/lib.linux-x86_64-2.7/pyofss/tests

copying pyofss/tests/test_filter.py -> build/lib.linux-x86_64-2.7/pyofss/tests

copying pyofss/tests/test_nonlinearity.py -> build/lib.linux-x86_64-2.7/pyofss/tests

copying pyofss/tests/test_stepper.py -> build/lib.linux-x86_64-2.7/pyofss/tests

copying pyofss/tests/test_gaussian.py -> build/lib.linux-x86_64-2.7/pyofss/tests

copying pyofss/tests/test_linearity.py -> build/lib.linux-x86_64-2.7/pyofss/tests

copying pyofss/tests/test_domain.py -> build/lib.linux-x86_64-2.7/pyofss/tests

copying pyofss/tests/test_sech.py -> build/lib.linux-x86_64-2.7/pyofss/tests

copying pyofss/tests/test_fibre.py -> build/lib.linux-x86_64-2.7/pyofss/tests

copying pyofss/tests/test_solver.py -> build/lib.linux-x86_64-2.7/pyofss/tests

copying pyofss/tests/__init__.py -> build/lib.linux-x86_64-2.7/pyofss/tests

running egg_info

writing requirements to pyofss.egg-info/requires.txt

writing pyofss.egg-info/PKG-INFO

writing top-level names to pyofss.egg-info/top_level.txt

writing dependency_links to pyofss.egg-info/dependency_links.txt

warning: manifest_maker: standard file '-c' not found



reading manifest file 'pyofss.egg-info/SOURCES.txt'

reading manifest template 'MANIFEST.in'

writing manifest file 'pyofss.egg-info/SOURCES.txt'

running install_lib

creating /usr/local/lib/python2.7/dist-packages/pyofss

error: could not create '/usr/local/lib/python2.7/dist-packages/pyofss': Permission denied

----------------------------------------
Cleaning up...
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip_build_zeglam/pyofss/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-eK437w-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip_build_zeglam/pyofss
Storing debug log for failure in /tmp/tmpa4SUaw

答案1

您尝试在虚拟环境之外使用 pip。这意味着它将尝试将内容安装到 root 拥有的全局 site-packages 中。两个选项:

  • 切换到用户拥有的虚拟环境中执行操作。这通常更安全,因为您不会覆盖系统拥有的文件。

    sudo apt-get install python-virtualenv
    virtuanev venv
    source ./venv/bin/activate
    pip install -U pip  # gets a better version of pip!
    pip install pyofss
    
  • 以 root 身份运行 pip 命令:

    sudo apt install python-numpy python-scipy python-matplotlib
    sudo pip install pyofss
    

相关内容