[在]:
from sklearn_extra.cluster import KMedoids
Run Code Online (Sandbox Code Playgroud)
[出去]:
ModuleNotFoundError: No module named 'sklearn_extra'
Run Code Online (Sandbox Code Playgroud)
然后,我尝试通过安装 sklearn_extra
[在]:
ModuleNotFoundError: No module named 'sklearn_extra'
Run Code Online (Sandbox Code Playgroud)
[出去]:
python -m pip install sklearn_extra
Run Code Online (Sandbox Code Playgroud)
然后,我去了网站的安装部分(https://scikit-learn-extra.readthedocs.io/en/latest/install.html)并按照它说的做了:
Installation
Dependencies
scikit-learn-extra requires,
Python (>=3.5)
scikit-learn (>=0.21), and its dependencies
Cython (>0.28)
User installation
Latest development version can be installed with,
pip install https://github.com/scikit-learn-contrib/scikit-learn-extra/archive/master.zip
Run Code Online (Sandbox Code Playgroud)
[在]:
ERROR: Could not find a version that satisfies the requirement sklearn_extra (from versions: none)
ERROR: No matching distribution found for sklearn_extra
Run Code Online (Sandbox Code Playgroud)
[出去]:
ERROR: Command errored out …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用 pyinstaller(版本 3.3.1)打包(冻结)一个 python3 应用程序
运行pyinstaller my_script.py后失败并显示导入错误列表,其中第一个错误如下:
292 INFO: checking Analysis
292 INFO: Building Analysis because out00-Analysis.toc is non existent
292 INFO: Initializing module dependency graph...
298 INFO: Initializing module graph hooks...
299 INFO: Analyzing base_library.zip ...
Failed to import the site module
Traceback (most recent call last):
File "/usr/local/Cellar/python3/3.6.4_2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site.py", line 544, in <module>
main()
...
Run Code Online (Sandbox Code Playgroud)
...并继续出现更长的导入错误列表这可能是我的 python3 配置或 pyinstaller 规范文件的问题。我目前使用的是默认的 pyinstaller 规范文件。以下是我正在测试的系统:
非常感谢您的帮助。
当我尝试安装fastai( pip install fastai) 时,出现以下错误:
AttributeError: module 'enum' has no attribute 'IntFlag'
Run Code Online (Sandbox Code Playgroud)
完整追溯:
Installing build dependencies ... error
ERROR: Complete output from command /usr/bin/python3 /usr/local/lib/python3.6/dist-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-b8vreosn/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools wheel 'numpy==1.13.3; python_version=='"'"'2.7'"'"' and platform_system!='"'"'AIX'"'"'' 'numpy==1.13.3; python_version=='"'"'3.5'"'"' and platform_system!='"'"'AIX'"'"'' 'numpy==1.13.3; python_version=='"'"'3.6'"'"' and platform_system!='"'"'AIX'"'"'' 'numpy==1.14.5; python_version>='"'"'3.7'"'"' and platform_system!='"'"'AIX'"'"'' 'numpy==1.16.0; python_version=='"'"'2.7'"'"' and platform_system=='"'"'AIX'"'"'' 'numpy==1.16.0; python_version=='"'"'3.5'"'"' and platform_system=='"'"'AIX'"'"'' 'numpy==1.16.0; python_version=='"'"'3.6'"'"' and platform_system=='"'"'AIX'"'"'' 'numpy==1.16.0; python_version>='"'"'3.7'"'"' and platform_system=='"'"'AIX'"'"'':
ERROR: Traceback (most recent call …Run Code Online (Sandbox Code Playgroud) 我需要将python代码编译为exe。我找到了一些如何做到这一点的指南,其中要求我为此安装 PyInstaller:
pip install --upgrade pyinstaller
Run Code Online (Sandbox Code Playgroud)
但我收到下一个错误:
C:\Users\alonat>pip install pyinstaller
Collecting pyinstaller
Using cached PyInstaller-3.6.tar.gz (3.5 MB)
Installing build dependencies ... error
ERROR: Command errored out with exit status 1:
command: 'c:\users\alonat\appdata\local\programs\python\python37-32\python.exe' 'c:\users\alonat\appdata\local\programs\python\python37-32\lib\site-packages\pip' install --ignore-installed --no-user --prefix 'C:\Users\alonat\AppData\Local\Temp\pip-build-env-yo59g2oq\overlay' --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'setuptools>=40.8.0' wheel
cwd: None
Complete output (14 lines):
Traceback (most recent call last):
File "c:\users\alonat\appdata\local\programs\python\python37-32\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "c:\users\alonat\appdata\local\programs\python\python37-32\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "c:\users\alonat\appdata\local\programs\python\python37-32\lib\site-packages\pip\__main__.py", line 23, in …Run Code Online (Sandbox Code Playgroud) 我用pyqt4做了一个程序。我试图通过 pyinstaller 创建一个可执行文件。但我失败了,我继续寻找原因。最后发现pyinstaller不支持pyqt4。于是我安装了pyqt5,把代码改成了pyqt5。但是pyinstaller还是报错,一定程度上解决了问题。我什至删除了pyqt4。但是我仍然没有解决下面的问题。
AttributeError: 模块“enum”没有属性“IntFlag”
它是引用
Traceback (most recent call last):
File "<string>", line 2, in <module>
ModuleNotFoundError: No module named 'sip'
Traceback (most recent call last):
File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\Scripts\pyinstaller-script.py", line 11, in <module>
load_entry_point('PyInstaller==3.4.dev0+ab8fd9753', 'console_scripts', 'pyinstaller')()
File "c:\program files (x86)\microsoft visual studio\shared\python36_64\lib\site-packages\PyInstaller\__main__.py", line 94, in run
run_build(pyi_config, spec_file, **vars(args))
File "c:\program files (x86)\microsoft visual studio\shared\python36_64\lib\site-packages\PyInstaller\__main__.py", line 46, in run_build
PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
File "c:\program files (x86)\microsoft visual studio\shared\python36_64\lib\site-packages\PyInstaller\building\build_main.py", line 791, in main
build(specfile, kw.get('distpath'), kw.get('workpath'), kw.get('clean_build')) …Run Code Online (Sandbox Code Playgroud) 我在这里阅读并尝试了所有评论:为什么Python 3.6.1抛出AttributeError:模块'enum'没有属性'IntFlag'?但仍然没有帮助。
我正在使用Pycharm Pycharm 2018.3 Community Edition,而我的Python版本是3.7
每次尝试为Pycharm设置解释器时,都会出现此错误:
Error in sitecustomize;
set PYTHONVERBOSE for traceback: AttributeError: module 'enum' has no attribute 'IntFlag'
Traceback (most recent call last): File "/Applications/PyCharm CE.app/Contents/helpers/packaging_tool.py", line 2, in <module>
import traceback File "/usr/local/Cellar/python/3.7.1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/traceback.py", line 5, in <module>
import linecache File "/usr/local/Cellar/python/3.7.1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/linecache.py", line 11, in <module>
import tokenize File "/usr/local/Cellar/python/3.7.1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/tokenize.py", line 33, in <module>
import re File "/usr/local/Cellar/python/3.7.1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/re.py", line 143, in <module>
class RegexFlag(enum.IntFlag): AttributeError: module 'enum' has no attribute 'IntFlag'
Run Code Online (Sandbox Code Playgroud)
希望得到帮助。
python ×5
pyinstaller ×3
fast-ai ×1
installation ×1
macos ×1
package ×1
pip ×1
pycharm ×1
pyqt4 ×1
pyqt5 ×1
python-3.x ×1
pytorch ×1
scikit-learn ×1