首页 > 解决方案 > 无法使用 flask.ext.classy

问题描述

我得到了一个使用 python 2.7 的项目。我已经获得了 requirements.txt 文件。

我创建了一个 conda 环境

conda create --name mypy2project python=2.7

然后我使用以下方法激活环境:

conda activate mypy2project

然后我使用以下方法安装要求:

pip install -r requirements.txt

该项目导入这样的类:

from flask.ext.classy import FlaskView, route
from flask.ext.login import LoginManager, login_user, logout_user, current_user, login_required

如果我将代码修改为 from flask_classy import FlaskView, route

然后项目工作。但是我无法提交这项工作,因为我与另一个人分享了它。

我错过了什么?

requirements.txt 文件包含:

# requirements.txt
alabaster==0.7.10
anaconda-client==1.6.14
anaconda-navigator==1.8.7
anaconda-project==0.8.2
asn1crypto==0.24.0
astroid==1.6.3
astropy==2.0.6
attrs==18.1.0
Babel==2.5.3
backports-abc==0.5
backports.functools-lru-cache==1.5
backports.shutil-get-terminal-size==1.0.0
backports.shutil-which==3.5.1
backports.ssl-match-hostname==3.5.0.1
beautifulsoup4==4.6.0
bitarray==0.8.1
bkcharts==0.2
blaze==0.11.3
bleach==2.1.3
Blueprints==2.3.0.2
bokeh==0.12.16
boto==2.48.0
Bottleneck==1.2.1
cdecimal==2.3
certifi==2018.4.16
cffi==1.11.5
chardet==3.0.4
click==6.7
cloudpickle==0.5.3
clyent==1.2.2
colorama==0.3.9
comtypes==1.1.4
conda==4.5.4
conda-build==3.10.5
conda-verify==2.0.0
configparser==3.5.0
contextlib2==0.5.5
cryptography==2.2.2
cx-Oracle==6.3.1
cycler==0.10.0
Cython==0.28.2
cytoolz==0.9.0.1
dask==0.17.5
datashape==0.5.4
decorator==4.3.0
distributed==1.21.8
docutils==0.14
entrypoints==0.2.3
enum34==1.1.6
et-xmlfile==1.0.1
fastcache==1.0.2
filelock==3.0.4
Flask==1.0.2
Flask-Cors==3.0.4
Flask-Login==0.4.1
Flask-LoginManager==1.1.6
Flask-SQLAlchemy==2.3.2
funcsigs==1.0.2
functools32==3.2.3.post2
future==0.16.0
futures==3.2.0
gevent==1.3.0
glob2==0.6
greenlet==0.4.13
grin==1.2.1
h5py==2.7.1
heapdict==1.0.0
html5lib==1.0.1
idna==2.6
imageio==2.3.0
imagesize==1.0.0
ipaddress==1.0.22
ipykernel==4.8.2
ipython==5.7.0
ipython-genutils==0.2.0
ipywidgets==7.2.1
isort==4.3.4
itsdangerous==0.24
jdcal==1.4
jedi==0.12.0
Jinja2==2.10
jsonschema==2.6.0
jupyter==1.0.0
jupyter-client==5.2.3
jupyter-console==5.2.0
jupyter-core==4.4.0
jupyter-echarts-pypkg==0.1.1
jupyterlab==0.32.1
jupyterlab-launcher==0.10.5
kiwisolver==1.0.1
lazy-object-proxy==1.3.1
llvmlite==0.23.1
lml==0.0.2
locket==0.2.0
lxml==4.2.1
MarkupSafe==1.0
matplotlib==2.2.2
mccabe==0.6.1
menuinst==1.4.14
mistune==0.8.3
mkl-fft==1.0.0
more-itertools==4.1.0
mpmath==1.0.0
msgpack==0.5.6
msgpack-python==0.5.6
multipledispatch==0.5.0
navigator-updater==0.2.1
nbconvert==5.3.1
nbformat==4.4.0
networkx==2.1
nltk==3.3
nose==1.3.7
notebook==5.5.0
numba==0.38.0+0.g2a2b772fc.dirty
numexpr==2.6.5
numpy==1.14.3
numpydoc==0.8.0
odo==0.5.1
olefile==0.45.1
openpyxl==2.5.3
packaging==17.1
pandas==0.23.0
pandocfilters==1.4.2
parso==0.2.0
partd==0.3.8
path.py==11.0.1
pathlib2==2.3.2
patsy==0.5.0
pep8==1.7.1
pickleshare==0.7.4
Pillow==5.1.0
pipenv==2018.5.18
pkginfo==1.4.2
pluggy==0.6.0
ply==3.11
prompt-toolkit==1.0.15
psutil==5.4.5
psycopg2==2.7.4
py==1.5.3
pycodestyle==2.4.0
pycosat==0.6.3
pycparser==2.18
pycrypto==2.6.1
pycurl==7.43.0.1
pyecharts==0.5.5
pyecharts-javascripthon==0.0.6
pyecharts-jupyter-installer==0.0.3
pyflakes==1.6.0
Pygments==2.2.0
pylint==1.8.4
pyodbc==4.0.23
pyOpenSSL==18.0.0
pyparsing==2.2.0
PySocks==1.6.8
pytest==3.5.1
python-dateutil==2.7.3
pytz==2018.4
PyWavelets==0.5.2
pywin32==223
pywinpty==0.5.1
PyYAML==3.12
pyzmq==17.0.0
QtAwesome==0.4.4
qtconsole==4.3.1
QtPy==1.4.1
requests==2.18.4
rope==0.10.7
ruamel-yaml==0.15.35
scandir==1.7
scikit-image==0.13.1
scikit-learn==0.19.1
scipy==1.1.0
seaborn==0.8.1
Send2Trash==1.5.0
simplegeneric==0.8.1
singledispatch==3.4.0.3
six==1.11.0
snowballstemmer==1.2.1
sortedcollections==0.6.1
sortedcontainers==1.5.10
Sphinx==1.7.4
sphinxcontrib-websupport==1.0.1
spyder==3.2.8
SQLAlchemy==1.2.7
statsmodels==0.9.0
subprocess32==3.5.0
sympy==1.1.1
tables==3.4.3
tblib==1.3.2
terminado==0.8.1
testpath==0.3.1
toolz==0.9.0
tornado==5.0.2
traitlets==4.3.2
typing==3.6.4
unicodecsv==0.14.1
urllib3==1.22
virtualenv==16.0.0
virtualenv-clone==0.3.0
virtualenvwrapper-win==1.2.5
wcwidth==0.1.7
webencodings==0.5.1
Werkzeug==0.14.1
widgetsnbextension==3.2.1
win-inet-pton==1.0.1
win-unicode-console==0.5
wincertstore==0.2
wrapt==1.10.11
xlrd==1.1.0
XlsxWriter==1.0.4
xlwings==0.11.8
xlwt==1.3.0
zict==0.1.3

我已经阅读了这篇文章,但仍然无法更改代码。我更喜欢先适应已经存在的东西,然后我会更改代码

标签: pythonpip

解决方案


推荐阅读