pydev giving Unresolved import, but works when executed

299 Views Asked by At

I used pip3.6.exe to install pycurl. Everything seemed to go ok with that. When I open the python command line, I can import pycurl just fine.

In pydev, I get a red X error on "import pycurl" which says "Unresolved import pycurl".

Most of the reading I've done on this error revolve around the PYTHONPATH for importing python files, but this is a module installed with pip, not a .py file a coworker sent me, so I'm thinking PYTHONPATH isn't the problem. Also, I can import other packages I've installed with pip.

The pycurl install has a folder in site-packages called "pycurl-7.43.0.1.dist-info", but NOT "pycurl". There is a "pycurl.cp36-win_amd64.pyd" file at the root of site-packages. When I make a copy of that named "pycurl.pyd", the unresolved import goes away.

While I guess this solves my problem, it doesn't feel like a good solution. It won't won't survive a re-install and isn't something I want to do on a server. Is there any way to get pydev to recognize .pyd files just as they're installed by pip, without manually renaming the .pyd file?

0

There are 0 best solutions below