Difficulty installing python modules after installing anaconda

落爺英雄遲暮 提交于 2019-12-11 17:13:02

问题


I just started working with anaconda. Earlier I was working with Python 2.7 on my system. I was writing a script for devices connected to my laptop via usb. For this, I needed the usb module/package. I initially tried doing in Python 27. I installed using:

easy_install libusb1

The output with this is ( screenshot is also there) :

Searching for libusb1
Best match: libusb1 1.4.0
Processing libusb1-1.4.0-py3.4.egg
libusb1 1.4.0 is already the active version in easy-install.pth

Using c:\users\eku\anaconda3\lib\site-packages\libusb1-1.4.0-py3.4.egg
Processing dependencies for libusb1
Finished processing dependencies for libusb1

C:\users\eku\anaconda3\ : this is the path according to my system whose name is eku.

Installing with pip shows an error unknown command libusb1

Because I have installed the package before, the screenshot shows the correct result that the package is already installed. But the locatio is where my anaconda's site-packages are there.

Why is this occurring and how should I correct this. I want to keep both anaconda and the other 2.7 version separate. (If this has something to do with path variable, then yes I am confused about the same).

As can be seen from the above output the libusb gets installed in in anaconda, I tried running the same code in Spyder (in anaconda). When I write,

import usb1

I get the error:

ImportError: No module named 'usb1'

Why is this happening?

My spyder got installed with anaconda itself. I simply click on its icon and the workspace launches. Nothing more I had to do, it started working and even my other files are working fine.

Thanks!


回答1:


I know it's a bit after the fact, but I had the same issue. I ended up searching my registry (I used a program called RegistryFinder, there are likely others) and finding that there was a registry value pointing to the Anaconda install directory. I deleted it and I was able to install things to my normal Python directory. I had previously uninstalled Anaconda and wasn't worried about having references to it, so you may want to save off those values.



来源:https://stackoverflow.com/questions/30759190/difficulty-installing-python-modules-after-installing-anaconda

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!