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

Configuring it with ECLIPSE PyDev #68

Closed
farrukhqayum opened this issue Apr 6, 2016 · 7 comments
Closed

Configuring it with ECLIPSE PyDev #68

farrukhqayum opened this issue Apr 6, 2016 · 7 comments

Comments

@farrukhqayum
Copy link

I wasn't able to configure pyproj with ECLIPSE. However, I was able to do it with standalone Py IDE.

Did any one try? What do I have to do it to properly run it in Eclipse.
I did properly add the source folders & eggs in pythonpath. I always get this error:

console: Failed to install '': java.nio.charset.UnsupportedCharsetException: cp0.
Traceback (most recent call last):
File "X:\Eclipse_Java_Workspace\CoordConv\src\subset.py", line 11, in
from pyproj import Proj, transform
File "C:\Python27\Lib\site-packages\pyproj-1.9.5.1-py2.7-win32.egg\pyproj__init__.py", line 51, in
from pyproj import _proj
File "C:\Python27\Lib\site-packages\pyproj-1.9.5.1-py2.7-win32.egg\pyproj_proj.py", line 7, in
bootstrap()
File "C:\Python27\Lib\site-packages\pyproj-1.9.5.1-py2.7-win32.egg\pyproj_proj.py", line 6, in bootstrap
imp.load_dynamic(name,file)
ImportError: No module named pyproj._proj

@micahcochran
Copy link
Collaborator

It is choking on this line, from pyproj import _proj. This is where pyproj imports the Cython portion (which in C code interfaces with the C library PROJ.4).

I did properly add the source folders & eggs in pythonpath.

If you install with pip, You have less to worry about those types of details because it will compile it for you. Run C:\..> pip install pyproj

@farrukhqayum
Copy link
Author

Thanks Micah for a swift reply.

I did this and the standalone Python works fine. It is only the ECLIPSE issue. It does not recognize the pyproj path.

eclipse

@micahcochran
Copy link
Collaborator

I don't have ECLIPSE installed. I've got two questions that *might* help.

What is the value of the variable pyproj.pyproj_datadir ?

Where is PROJ.4 installed on your box?

@farrukhqayum
Copy link
Author

Following your e-mail I used the pip installation without setting the PROJ.4. So, I assume it is using the src. Thus, I should not link it to the environment variable PROJ_DIR. With this installation, Python IDLE works fine as shown in the previous attachmen (bottom left). Eclipse does not!

However, I also have a standalone installation of PROJ.4 located under:

C:\Python27\Lib\site-packages\proj.4

The datadir file has the following contents.

if 'PROJ_DIR' in os.environ:
pyproj_datadir = os.environ['PROJ_DIR']
else:
pyproj_datadir = os.sep.join([os.path.dirname(file), 'data'])

image

Eclipse setup is like this:

image

@farrukhqayum
Copy link
Author

Resolution:

The main problem was the compilation of the PROJ.4. It was using ./configure in the cygwin.

Then I ran the preinstalled MSVC 8 command prompt via the start menu and ran nmake. It created the share/ folder in the installation path (set by editing the nmake*.opt file (INSTDIR = c:\Proj). After this, the eggs of pyproj were correctly build by running the pyproj (using python setup.py pyproj).

I have seen many users suffered in the Eclipse to properly do this.

@micahcochran
Copy link
Collaborator

I'm glad you figure it out. Thanks for sharing the solution.

@snowman2
Copy link
Member

Closing as solution found. Thanks for sharing!

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

3 participants