-->

Welcome to our Coding with python Page!!! hier you find various code with PHP, Python, AI, Cyber, etc ... Electricity, Energy, Nuclear Power

Tuesday, 3 September 2019

python -m causes “Error while finding module specification for”

You're supposed to use the m without the .py suffix, i.e.: $ python -m aname
From the man page:
       -m module-name
              Searches sys.path for the named module and runs the corresponding .py file as
              a script.
The m parameter is a module, similar to import or from.

1 comment:

  1. Question: I am getting the same error python -m ~/.conda/envs/open2c/bin/pip vs python -m pip. I run into the problem because I am trying to create an environment using conda env create -f environment.yml command. The trace shows python tagging on the path top pip as opposed to just doing python -m pip. I feel it must having something to do with an env variable. Any ideas?

    ReplyDelete

Thanks for your comments

Rank

seo