PyQt-Fit 安装失败



在 Python 3.8.3 的 Windows 10 机器上安装失败

pip install PyQt-Fit
ERROR: Command errored out with exit status 1:
command: 'c:usersmkzappdatalocalprogramspythonpython38python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:UsersmkzAppDataLocalTemppip-install-rn6exgn0distributesetup.py'"'"'; file='"'"'C:UsersmkzAppDataLocalTemppip-install-rn6exgn0distributesetup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' egg_info --egg-base 'C:UsersmkzAppDataLocalTemppip-pip-egg-info-6yfk5kue'
cwd: C:UsersmkzAppDataLocalTemppip-install-rn6exgn0distribute
Complete output (15 lines):
Traceback (most recent call last):
File "", line 1, in
File "C:UsersmkzAppDataLocalTemppip-install-rn6exgn0distributesetuptools_init_.py", line 2, in
from setuptools.extension import Extension, Library
File "C:UsersmkzAppDataLocalTemppip-install-rn6exgn0distributesetuptoolsextension.py", line 5, in
from setuptools.dist import get_unpatched
File "C:UsersmkzAppDataLocalTemppip-install-rn6exgn0distributesetuptoolsdist.py", line 7, in
from setuptools.command.install import install
File "C:UsersmkzAppDataLocalTemppip-install-rn6exgn0distributesetuptoolscommand_init.py", line 8, in
from setuptools.command import install_scripts
File "C:UsersmkzAppDataLocalTemppip-install-rn6exgn0distributesetuptoolscommandinstall_scripts.py", line 3, in
from pkg_resources import Distribution, PathMetadata, ensure_directory
File "C:UsersmkzAppDataLocalTemppip-install-rn6exgn0distributepkg_resources.py", line 1518, in
register_loader_type(importlib_bootstrap.SourceFileLoader, DefaultProvider)
AttributeError: module 'importlib._bootstrap' has no attribute 'SourceFileLoader'
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

花了几个小时后,我意识到也许 PyQt-Fit 仅适用于 python 2.7,然后我使用 python 2.7 创建了一个 conda 环境并创建了一个内核

//This is for conda to support switching kernels
conda install nb_conda
conda create -n py27 python=2.7
conda activate py27
//install PyQt-Fit
pip install -I path.py==7.7.1
pip install git+https://github.com/Multiplicom/pyqt-fit.git
// This is needed for Jupyter Notebook connecting with new kernel
pip install pypiwin32
//Make sure you are at the same directory as the py27 env, for example, C:Anaconda3envspy27
//Create a new kernel
conda install notebook ipykernel
ipython kernelspec install-self
//now run jupyter notebook

一些有用的链接帮助我解决问题。

https://docs.continuum.io/anaconda/user-guide/tasks/use-jupyter-notebook-extensions/

https://github.com/ipython/ipykernel/issues/52

Jupyter 在哪个 conda 环境中执行?

PyQt_Fit:无法导入名称路径

最新更新