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

[Anaconda | Python2.7] ImportError: No module named pyshp #142

Open
shCampos opened this issue May 30, 2018 · 5 comments
Open

[Anaconda | Python2.7] ImportError: No module named pyshp #142

shCampos opened this issue May 30, 2018 · 5 comments
Labels
investigate Needs to be looked at more closely platform-support

Comments

@shCampos
Copy link

Hi
I'm working with Anaconda and Python 2.7, and I installed pyshp using conda-forge.
To test, I imported the library like this:

import pyshp

However, the following error appeared:

ImportError: No module named pyshp

But when I do this:

import shapefile

no errors appear.
Just to test, I uninstalled the library and reinstalled using pip, but the same thing happens. I really need to import pyshp, because with shapefile my code does not run (I also do not know the reason).

Thanks for the help :)

@sunshinejnjn
Copy link

sunshinejnjn commented May 30, 2018 via email

@shCampos
Copy link
Author

shCampos commented May 30, 2018

Thank you for your answer.
I did this, but the error continues. Does it have anything to do with the file shapefile.pyc?

@karimbahgat karimbahgat added the investigate Needs to be looked at more closely label Jun 23, 2018
@jayaBalaR
Copy link

I am also facing this issue since this morning . Followed the steps given by @sunshinejnjn, also explicitly ran sys.path.append(os.getcwd()) in cell before importing in my code.
Could you let me know if there is any workaround for this issue

Thank you

@karimbahgat
Copy link
Collaborator

karimbahgat commented Mar 9, 2020

Seems there might be a confusion here. Pyshp is just the name of the package on PyPI.
The package name when running in the code is shapefile, so the import is done with import shapefile. Going through the examples as laid out in the README should work.

(The version number or sys.path location should not impact this issue, and v2 has since been made available through pip.)

@jayaBalaR have you tried using import shapefile instead of import pyshp? If you're running import shapefile and it doesn't work, can you post here which error message you're getting?

@jayaBalaR
Copy link

@karimbahgat , I have tried to import shapefile, faced with error
shapefile_error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
investigate Needs to be looked at more closely platform-support
Projects
None yet
Development

No branches or pull requests

4 participants