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

When I install pyproj, pip returns error 127 #323

Closed
bluems opened this issue May 28, 2019 · 7 comments · Fixed by #342
Closed

When I install pyproj, pip returns error 127 #323

bluems opened this issue May 28, 2019 · 7 comments · Fixed by #342
Labels
installation-issues Issue related to installation problems.

Comments

@bluems
Copy link

bluems commented May 28, 2019

OS: Raspbian latest version(Kernel 4.19.42)
Python: 3.6.8
Proj: 6.1.0

When I install pyproj, pip returns error 127.

Error Message:

subprocess.CalledProcessError: Command '['/usr/local/bin/proj']' returned non-zero exit status 127.

run sudo find / -name proj:

/usr/local/bin/proj

How do I install this?

@snowman2
Copy link
Member

Interesting, what happens when you execute /usr/local/bin/proj? Also, what are the permissions on /usr/local/bin/proj?

@snowman2 snowman2 added installation-issues Issue related to installation problems. closing-soon-if-no-response If no response occurs within a few days, the issue will be closed. labels May 28, 2019
@bluems
Copy link
Author

bluems commented Jun 4, 2019

@snowman2

pi@raspberrypi:~ $ /usr/local/bin/proj
Rel. 6.1.0, May 15th, 2019
usage: proj [-bdeEfiIlmorsStTvVwW [args]] [+opt[=arg] ...] [file ...]

and

pi@raspberrypi:~ $ ls -al /usr/local/bin/proj
-rwxr-xr-x 1 root staff 150372 May 28 14:18 /usr/local/bin/proj

Currently, it works as normal.
The only action I have taken is to attempt to rebuild venv several times through PyCharm or virtualenv.

pip install -r requirements.txt

@micahcochran
Copy link
Collaborator

micahcochran commented Jun 4, 2019

@bluems

Run this from a python console:

import subprocess
proj_ver_bytes = subprocess.check_output(['/usr/local/bin/', 'proj'], stderr=subprocess.STDOUT)

It should give you the same Exception.

Try this one:

proj_ver_bytes = subprocess.check_output('/usr/local/bin/proj', stderr=subprocess.STDOUT)

I saw some forum post that were suggesting that the first argument in subprocess.check_output() should be a string for Raspberry Pi Python, instead of a list.

When you run pip, the first example is essentially what setup.py is doing in check_proj_version(). It is making sure that you have the correct version of PROJ installed.

EDIT added below:
One more test. From bash run the following:

$ /usr/local/bin/proj

$ echo $?

$? should print out the exit code.

@snowman2 snowman2 removed the closing-soon-if-no-response If no response occurs within a few days, the issue will be closed. label Jun 4, 2019
@bluems
Copy link
Author

bluems commented Jun 5, 2019

@micahcochran

Run this from a python console:

Return Exception:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.6/subprocess.py", line 356, in check_output
    **kwargs).stdout
  File "/usr/local/lib/python3.6/subprocess.py", line 423, in run
    with Popen(*popenargs, **kwargs) as process:
  File "/usr/local/lib/python3.6/subprocess.py", line 729, in __init__
    restore_signals, start_new_session)
  File "/usr/local/lib/python3.6/subprocess.py", line 1364, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
PermissionError: [Errno 13] Permission denied: '/usr/local/bin/'

It's interesting.
Because, run /usr/local/bin/proj is correctly return.

(venv) pi@raspberrypi:~/lx/python $ /usr/local/bin/proj
Rel. 6.1.0, May 15th, 2019
usage: proj [-bdeEfiIlmorsStTvVwW [args]] [+opt[=arg] ...] [file ...]

Try this one:

But, the above code seems to work normally.
Your thoughts are right.

One more test. From bash run the following:

Run echo $?:

  1. No Error.

EDIT added below:

Check my proj permission:

pi@raspberrypi:~/lx/python $ ls -al /usr/local/bin
total 20608
drwxrwsr-x  2 root staff    4096 May 28 14:18 .
drwxrwsr-x 10 root staff    4096 Apr  8 18:37 ..
... Intermediate omission
-rwxr-xr-x  1 root staff  150372 May 28 14:18 proj
-rwxr-xr-x  1 root staff 1078612 May 28 14:18 projinfo
-rwxr-xr-x  1 root staff      84 May 27 19:44 pydoc3.6
-rwxr-xr-x  2 root staff 9607796 May 27 19:41 python3.6
... Omitted below.

@micahcochran
Copy link
Collaborator

@bluems

I messed up the my first test. I should have testing it out before posting. Sorry. Ignore that one.

So, it sounds like the second test worked.

Does this work (Test 4)? (This is actually what is being run in setup.py by pip).

proj_ver_bytes = subprocess.check_output(['/usr/local/bin/proj'], stderr=subprocess.STDOUT)

If that reproduces the problem, this should be an easy fix.

@snowman2
Copy link
Member

snowman2 commented Jun 7, 2019

@bluems can you try:

pip install git+https://github.com/snowman2/pyproj@657cc427

@snowman2
Copy link
Member

snowman2 commented Jun 7, 2019

Looks like merging the change to master closed this issue. @bluems wr would still appreciate your feedback. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
installation-issues Issue related to installation problems.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants