我在系统范围内安装了goose,但是我没有使用过的virtualenv
$ python -c "import goose" #ok
(venv)$ python -c "import goose" #not ok
Traceback (most recent call last):
File "<string>", line 1, in <module>
ImportError: No module named goose
设置说明说
mkvirtualenv --no-site-packages goose
git clone https://github.com/grangier/python-goose.git
cd python-goose
pip install -r requirements.txt
python setup.py install
如何在现有的virtualenv venv
中安装它?
答案 0 :(得分:1)
mkvirtualenv goose_project
workon goose_project
git clone https://github.com/grangier/python-goose
cd python-goose/
python setup.py install
并验证安装
pip freeze | grep "goose"
goose-extractor==1.0.22
答案 1 :(得分:0)
按照设置说明操作,但在致电workon venv
或. venv/bin/activate
之前激活您的virtualenv(pip
或python
)。