I can't import the package that should have been conda installed in Anaconda

problem

The package that should have been installed in Anaconda could not be used, and the following error occurred.

ModuleNotFoundError: No module named 'selenium'

I should have installed selenium this time, but I got the above error.

Cause

I was using py.exe when running a python program (****. Py) at the anaconda prompt.

Countermeasures

When starting, it was described as follows.

Previous: py *********. Py (I got an error)

After: python *********. Py (works)

Impressions

I learned that pyrhon.exe and py.exe are different (I thought they were the same until now) A new question arose as to what exactly py.exe is It's a very simple problem to solve, but it took a long time It was a simple mistake, and I couldn't find it even if I searched on the net. I hope this article helps someone.

The way to a solution

It is a memo for myself

  1. Notice the problem
  2. Find out where you are importing py and python packages
import sys,pprint
pprint.pprint(sys.path)

Notice that the results are different !! (Approximately 2 hours in total)

  1. Solution (do not proceed with work)

Recommended Posts

I can't import the package that should have been conda installed in Anaconda
[Ruby] The gem should have been installed in vendor / bundle, but an error occurs in require
Create a database of all the books that have been circulating in Japan in the last century
[Java] ArrayList → Should I specify the size in array conversion?
I have summarized the articles that programming beginners referred to.
I touched the devise controller that I felt in the black box