mapnik / python-mapnik

Python bindings for mapnik
GNU Lesser General Public License v2.1
157 stars 91 forks source link

mapnik-config #195

Open ziya5635 opened 6 years ago

ziya5635 commented 6 years ago

Hi, I have been trying to build it from the source using python3 on mac. Once I run python3 setup.py install, I face the following error:

sh-3.2# python3 setup.py install Traceback (most recent call last): File "setup.py", line 114, in lib_path = os.path.join(check_output([mapnik_config, '--prefix']),'lib') File "setup.py", line 20, in check_output output = subprocess.check_output(args) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/subprocess.py", line 336, in check_output *kwargs).stdout File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/subprocess.py", line 403, in run with Popen(popenargs, **kwargs) as process: File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/subprocess.py", line 709, in init restore_signals, start_new_session) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/subprocess.py", line 1344, in _execute_child raise child_exception_type(errno_num, err_msg, err_filename) FileNotFoundError: [Errno 2] No such file or directory: 'mapnik-config': 'mapnik-config'

Could someone please help me, I have been trying to install this library for the past three days, but no success!

talaj commented 6 years ago

If you have Mapnik installed, mapnik-config should be part of the installation. It needs to be accessible through PATH variable.

ziya5635 commented 6 years ago

Thank you for your response, no actually it is not installed yet. I am trying to install it by this command: python3 setup.py install, but when it is run, I face that error that says it can not find the file named mapnik-config! I have cloned the repository on my local machine and the following is what I already have inside that directory: . .travis.yml README.md mapnik test .. AUTHORS.md bootstrap.sh scripts .git CHANGELOG.md build.py setup.cfg .gitignore CONTRIBUTING.md demo setup.py .gitmodules COPYING docs src

is there something wrong?

ziya5635 commented 6 years ago

This is actually the whole error that I am facing:

ziyas-MacBook-Air:python-mapnik ziya$ python3 setup.py install Traceback (most recent call last): File "setup.py", line 114, in lib_path = os.path.join(check_output([mapnik_config, '--prefix']),'lib') File "setup.py", line 20, in check_output output = subprocess.check_output(args) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/subprocess.py", line 336, in check_output *kwargs).stdout File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/subprocess.py", line 403, in run with Popen(popenargs, **kwargs) as process: File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/subprocess.py", line 709, in init restore_signals, start_new_session) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/subprocess.py", line 1344, in _execute_child raise child_exception_type(errno_num, err_msg, err_filename) FileNotFoundError: [Errno 2] No such file or directory: 'mapnik-config': 'mapnik-config'

talaj commented 6 years ago

python3 setup.py install installs only the python bindings. You need to install Mapnik first: https://github.com/mapnik/mapnik

But there is a lot of dependencies. Isn't it possible to install it from some binary package on Mac? I'm sorry, I'm not a Mac user.

ziya5635 commented 6 years ago

thank you, no actually there is just version 2 that is binary that requires python 3.3 that is already expired! To be honest, I installed the binary version and it by default made a folder named python.3.3 on my local machine, so I installed that version and it worked, but the problem is that python version is not supported and I can not install other libraries that I need like gdal, so practically I would have just mapnik working on that version! that is why I am trying to install the new version on python3.6 where I already have all the required packages for my work.

ziya5635 commented 5 years ago

so now I am trying to install it with the link you suggested and when I run ./configure, I face:

Exiting... the following required dependencies were not found:

talaj commented 5 years ago

I have basically no idea how to proceed on Mac. I would recommend you to use Ubuntu Bionic for the task. https://github.com/mapnik/mapnik/issues/3985 is a very recent issue where a user successfully used Mapnik on Ubuntu Bionic to render maps from openstreetmaps.org.

ziya5635 commented 5 years ago

Ok, thank you for your help. I appreciate it.

ziya5635 commented 5 years ago

I finally manages to install it by the following commands on mac, but in the next step(installing dependencies) I face an error when run python3 setup.py install, which I mentioned at the end of this page, do you know that error?

(Press Command+Space and type Terminal and press enter/return key.
Run in Terminal app:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" < /dev/null 2> /dev/null
and press enter/return key.
If the screen prompts you to enter a password, please enter your Mac's user password to continue. When you type the password, it won't be displayed on screen, but the system would accept it. So just type your password and press ENTER/RETURN key. Then wait for the command to finish.
Run:
brew install freetype)

error: ld: library not found for -lboost_python clang: error: linker command failed with exit code 1 (use -v to see invocation) error: command 'clang++' failed with exit status 1

soccerdroid commented 5 years ago

Have the same issue, but I have already built mapnik. When executing python3.6 setupy.py install, the output is:

File "setup.py", line 114, in lib_path = os.path.join(check_output([mapnik_config, '--prefix']),'lib') File "setup.py", line 20, in check_output output = subprocess.check_output(args) File "/usr/lib64/python3.6/subprocess.py", line 336, in check_output *kwargs).stdout File "/usr/lib64/python3.6/subprocess.py", line 403, in run with Popen(popenargs, **kwargs) as process: File "/usr/lib64/python3.6/subprocess.py", line 709, in init restore_signals, start_new_session) File "/usr/lib64/python3.6/subprocess.py", line 1344, in _execute_child raise child_exception_type(errno_num, err_msg, err_filename) FileNotFoundError: [Errno 2] No such file or directory: 'mapnik-config': 'mapnik-config'

But if I run mapnik-config --prefix in the terminal, I get

b'/usr/local'

I have already added that location in my $PATH variable Any hints/ideas?

soccerdroid commented 5 years ago

Have the same issue, but I have already built mapnik. When executing python3.6 setupy.py install, the output is:

File "setup.py", line 114, in lib_path = os.path.join(check_output([mapnik_config, '--prefix']),'lib') File "setup.py", line 20, in check_output output = subprocess.check_output(args) File "/usr/lib64/python3.6/subprocess.py", line 336, in check_output *kwargs).stdout File "/usr/lib64/python3.6/subprocess.py", line 403, in run with Popen(popenargs, kwargs) as process: File "/usr/lib64/python3.6/subprocess.py", line 709, in init** restore_signals, start_new_session) File "/usr/lib64/python3.6/subprocess.py", line 1344, in _execute_child raise child_exception_type(errno_num, err_msg, err_filename) FileNotFoundError: [Errno 2] No such file or directory: 'mapnik-config': 'mapnik-config'

But if I run mapnik-config --prefix in the terminal, I get

b'/usr/local'

I have already added that location in my $PATH variable Any hints/ideas?

I figured it out. My $PATH variable was different for root user. I checked where mapnik-config was (in my case it was /usr/bin) and added that location following this steps. I have other problems now with mapnik...