简体   繁体   中英

Python- can't install non-conda package

I installed anaconda2-4.4.0 in path /opt/anaconda and add it as my Pycharm interpreter and all things went well until I needed to install non-conda python package in this link . I installed it using pip command and it was in my Python packages using command pip list , But the problem is that package was not included in Conda, as I checked using command conda list and I couldn't import it in my project that uses anaconda as Python interpreter as well. I try installing my package offline using command conda install --offline Downloads/hazm-master.tar.bz2 , But it was errorful.

KeyError: Dist(_Dist__initd=True, channel=u'<unknown>', dist_name=u'hazm-master', name=u'hazm', version=u'master', build_string=u'', build_number=0, with_features_depends=None, base_url=u'file:///home/soheil/Downloads', platform=None)

How can I add my desired package on anaconda packages?

You need to call pip to do that. So what should work is

Conda.add("pip")
pip = joinpath(Conda.BINDIR, "pip")
run(`$pip install -e 'git+https://github.com/sobhe/hazm`)

On windows is might be

pip = joinpath(Conda.SCRIPTDIR, "pip")
# On UNIX, Conda.SCRIPTDIR == Conda.BINDIR

EDIT

However; You can also catch up this link to install the non-conda packages(Thanks to @Sraw's assistance)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM