Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ModuleNotFoundError: No module named 'meshmagick_cli' #27

Closed
battuta opened this issue May 4, 2021 · 11 comments · Fixed by #40
Closed

ModuleNotFoundError: No module named 'meshmagick_cli' #27

battuta opened this issue May 4, 2021 · 11 comments · Fixed by #40

Comments

@battuta
Copy link

battuta commented May 4, 2021

Hi, I am getting this error when I am trying to run the code "meshmagick".

`Microsoft Windows [Version 10.0.19042.631]
(c) 2020 Microsoft Corporation. All rights reserved.

C:\Windows\system32>meshmagick
Traceback (most recent call last):
File "C:\Users\User\AppData\Local\Programs\Python\Python38\Scripts\meshmagick-script.py", line 11, in
load_entry_point('meshmagick==2.1.1', 'console_scripts', 'meshmagick')()
File "c:\users\User\appdata\local\programs\python\python38\lib\site-packages\pkg_resources_init_.py", line 489, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "c:\users\User\appdata\local\programs\python\python38\lib\site-packages\pkg_resources_init_.py", line 2852, in load_entry_point
return ep.load()
File "c:\users\User\appdata\local\programs\python\python38\lib\site-packages\pkg_resources_init_.py", line 2443, in load
return self.resolve()
File "c:\users\User\appdata\local\programs\python\python38\lib\site-packages\pkg_resources_init_.py", line 2449, in resolve
module = import(self.module_name, fromlist=['name'], level=0)
ModuleNotFoundError: No module named 'meshmagick_cli'
`

@frongere
Copy link
Member

frongere commented May 5, 2021

My advice:

  • use the miniconda Python distribution instead of a system install
  • install meshmagick using pip (pip install . while in the meshmagick directory)

@battuta
Copy link
Author

battuta commented May 7, 2021

Trying to install conda 4.2 > failed
Untitled

Trying to install meshmagick without conda 4.2 > failed
Untitled2

@frongere
Copy link
Member

frongere commented May 7, 2021

The point was to install miniconda to get a Python 3.X distribution then install meshmagick using pip install . or pip install -e . if you want to be able to update meshmagick by only pulling the git repository on your local machine. One of these commands has to be run in the meshmagick root directory, where the setup.py file is located.

Don't use the conda install command as it is not up to date anymore. I have to refresh the documentation, sorry.

@battuta
Copy link
Author

battuta commented May 8, 2021

It works now. THANK YOU!

We didn’t have these issues, one year ago, when we dealt with meshmagick for the first time. So, we hope you Update the documentations. Nevertheless, you are doing a great job! That really helped us before in our graduation project which was on marine engineering field.

Keep up the good work. 💪

@frongere
Copy link
Member

Thank you! Happy to see it helps 👍
New features to come soon...

@dforbush2
Copy link

I am seeing an identical error, but 'pip install .' did not resolve the problem.
I have tried cloning the repository and running 'python setup.py install', and gotten this same error.
I have also tried the pip install method, as well as conda install (but this latter is not expected to work).

I have attempted the above in both a py37 and py38 environment.

@russell-sealand
Copy link

russell-sealand commented Nov 15, 2021

The point was to install miniconda to get a Python 3.X distribution then install meshmagick using pip install . or pip install -e . if you want to be able to update meshmagick by only pulling the git repository on your local machine. One of these commands has to be run in the meshmagick root directory, where the setup.py file is located.

Don't use the conda install command as it is not up to date anymore. I have to refresh the documentation, sorry.

After following these instructions, I installed the latest Miniconda with Python 3.9, but still no success.

I tried with Meshmagick 3.2 and 3.3, but both give the following error:

(base) PS C:\temp2> meshmagick
Traceback (most recent call last):
File "d:\miniconda3\lib\runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "d:\miniconda3\lib\runpy.py", line 87, in run_code
exec(code, run_globals)
File "d:\miniconda3\Scripts\meshmagick.exe_main
.py", line 4, in
ModuleNotFoundError: No module named 'meshmagick_cli'

@mancellin
Copy link
Contributor

I can confirm that the cli is broken when the package is installed with

pip install https://github.com/LHEEA/meshmagick/archive/master.zip

or

pip install .

It seems to work only when the package is installed in editable mode:

pip install -e .

I guess the reason is that with a normal (non-editable) installation, only the content of the meshmagick directory is actually installed, so Python can't find meshmagick_cli in the parent directory.

@mancellin
Copy link
Contributor

mancellin commented Jul 12, 2023

  • With git:
git clone https://github.com/LHEEA/meshmagick.git
cd meshmagick
pip install -e .
  • Without git:
    Download https://github.com/LHEEA/meshmagick/archive/master.zip and unzip it. In the directory meshmagick-master run
pip install -e .

(Beware that it may break if you delete/move the directory you downloaded.)

@russell-sealand
Copy link

Success! Many thanks! Now I can finally try MeshMagick 2 years later! 💥

Hopefully the Readme.rst gets updated to reflect this installation process!

@mancellin
Copy link
Contributor

Hopefully the Readme.rst gets updated to reflect this installation process!

Now that #40 has been merged, the command in the README should work directly, no need for -e anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants