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

Cannot import mesh #55

Closed
majikbyte opened this issue Jun 11, 2017 · 14 comments
Closed

Cannot import mesh #55

majikbyte opened this issue Jun 11, 2017 · 14 comments
Assignees

Comments

@majikbyte
Copy link

I'm a novice and this is probably user error, but when I run my program I receive error: cannot import mesh.

Any idea what this may be about? Please be specific in your response, as I am a beginner in Python.

Thanks so much for your help.

@wolph
Copy link
Owner

wolph commented Jun 11, 2017

There are two common problems that can cause this error.

  1. You have a different stl module installed (this one: https://pypi.python.org/pypi/stl). Which is incompatible with this module. You can uninstall it through: pip uninstall -y stl
  2. You have a file named stl.py in your current directory. Please rename it to something else and make sure you remove or rename any stl.pyc and/or stl.pyo files as well.

@wolph wolph self-assigned this Jun 11, 2017
@majikbyte
Copy link
Author

majikbyte commented Jun 11, 2017 via email

@wolph
Copy link
Owner

wolph commented Jun 11, 2017 via email

@Amartya32
Copy link

Cannot install https://pypi.org/project/stl/#files as it gives an error "SyntaxError: invalid syntax

----------------------------------------

Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-HKGsjV/stl/
"

I need it for the numpy-stl which gives an error No module error.

I also checked I don't have any other stl packages installed. I am using Python3 should I be using pip3 install ?

best wishes

@wolph
Copy link
Owner

wolph commented Mar 30, 2020

If you're using python 3,using pip3 is usually a good idea so you have a better chance of getting the right pip version.

That won't help you here however. This is the numpy-stl package, not stl. You're installing the wrong package.

@Amartya32
Copy link

Well, I have installed numpy-stl using pip yet I am getting the no module error

@wolph
Copy link
Owner

wolph commented Mar 31, 2020

You can try uninstalling and reinstalling all stl packages to try and fix it.

  1. Uninstall STL: pip uninstall -y stl
  2. Uninstall Numpy-STL: pip uninstall -y numpy-stl
  3. Install Numpy-STL: pip install -U numpy-stl

(or pip3, it depends on your environment)

@Amartya32
Copy link

Thanks, but it hasn't helped. I still get the No module found error.
It installs with pip but not with pip3 which gives an error
" await = None
^
SyntaxError: invalid syntax

----------------------------------------

Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-avd0nmgr/numpy-stl/
"

@wolph
Copy link
Owner

wolph commented Mar 31, 2020

I'm not sure what is wrong but this library doesn't even use await so you're plagued by some local issue.

You can try it from a new project directory to see if that helps.
You can also try creating a virtual environment and working from there: https://docs.python-guide.org/dev/virtualenvs/

@Amartya32
Copy link

Thanks I will have a go at it. Cheers!

@yaofuzhou
Copy link

I have the same issue as Amartya32.

@Rakesh-Raushan
Copy link

Restarting the Kernel helped me resolve this issue. I think once you install stl instead of numpy-stl, the code somehow keeps referring to that even after uninstall. You would need to restart the kernel. Hope this helps.

@AMMARBRO111
Copy link

how can I solve this error "module 'stl' has no attribute 'BaseStl'"?

@wolph
Copy link
Owner

wolph commented Jan 31, 2024

@AMMARBRO111 It is usually caused by having a conflicting library installed. You can try this:
#55 (comment)

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

No branches or pull requests

6 participants