I am trying to install Mesos to in my container (CentOS 7) to have the Mesos libraries installed for my scheduler (python).
I followed 'Installing Mesos packages' section in https://open.mesosphere.com/downloads/mesos/
After successfully running:
$ rpm -Uvh http://repos.mesosphere.com/el/7/noarch/RPMS/mesosphere-el-repo-7-3.noarch.rpm
$ yum -y install --enablerepo=mesosphere mesos
$ pip install protobuf
I see Mesos packages in pip
However, from python, I cannot import Mesos scheduler driver:
Python 2.7.5 (default, Nov 6 2016, 00:28:07)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-11)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from mesos.interface import Scheduler
>>> from mesos.native import MesosSchedulerDriver
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.7/site-packages/mesos/native/__init__.py", line 18, in <module>
from mesos.scheduler import MesosSchedulerDriver
File "/usr/lib/python2.7/site-packages/mesos/scheduler/__init__.py", line 17, in <module>
from ._scheduler import MesosSchedulerDriverImpl as MesosSchedulerDriver
ImportError: /usr/lib/python2.7/site-packages/mesos/scheduler/_scheduler.so: undefined symbol: svn_txdelta2
Any ideas?
Well, I'm not an expert on this, but I think the packages don't install the development dependencies. Have a look at http://mesos.apache.org/gettingstarted/
In your case, you seem to miss a SVN library.
Related
I am trying to set up an environment using pyenv and homebrew on Ubuntu 20.04. There are no problems with my system install of python. However, when I install a specific version of python using pyenv I run into the following problem upon running Jupyter:
> jupyter notebook
Traceback (most recent call last):
File "/home/parzydlo/.pyenv/versions/3.10.3/bin/jupyter-notebook", line 5, in <module>
from notebook.notebookapp import main
File "/home/parzydlo/.pyenv/versions/3.10.3/lib/python3.10/site-packages/notebook/notebookapp.py", line 76, in <module>
from .base.handlers import Template404, RedirectWithParams
File "/home/parzydlo/.pyenv/versions/3.10.3/lib/python3.10/site-packages/notebook/base/handlers.py", line 35, in <module>
from notebook.utils import is_hidden, url_path_join, url_is_absolute, url_escape, urldecode_unix_socket_path
File "/home/parzydlo/.pyenv/versions/3.10.3/lib/python3.10/site-packages/notebook/utils.py", line 8, in <module>
import ctypes
File "/home/parzydlo/.pyenv/versions/3.10.3/lib/python3.10/ctypes/__init__.py", line 8, in <module>
from _ctypes import Union, Structure, Array
ModuleNotFoundError: No module named '_ctypes'
To verify the package is missing:
> python3
Python 3.10.3 (main, Apr 7 2022, 19:51:28) [GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import ctypes
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/parzydlo/.pyenv/versions/3.10.3/lib/python3.10/ctypes/__init__.py", line 8, in <module>
from _ctypes import Union, Structure, Array
ModuleNotFoundError: No module named '_ctypes'
When I switch back to system python:
> pyenv local system
> python3
Python 3.9.12 (main, Mar 23 2022, 21:36:19)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import ctypes
>>>
Following numerous threads here on SO I installed libffi-dev and tried reinstalling pyenv python but the problem persists. Perhaps it is worth mentioning that I'm using homebrew as my package manager, but had to install libffi-dev using apt.
Finally, I read [this post on dev.to][1] which suggested the following fix:
CC="$(brew --prefix gcc)/bin/gcc-11" \
pyenv install --verbose 3.10.0
Unfortunately, this too did not resolve the issue.
[1]: https://dev.to/ajkerrigan/homebrew-pyenv-ctypes-oh-my-3d9#isolating-the-useful-change
I have similar issue, the trick is you need to reinstall the same python version, e.g pyenv install -f after all apt install lib**-dev.
How do I install the redhat yum packages within an anaconda environment on CentOS? These packages exist in the standard Centos dist:
$ lsb_release -d
Description: CentOS Linux release 7.3.1611 (Core)
$ python
Python 2.7.5 (default, Nov 6 2016, 00:28:07)
Type "help", "copyright", "credits" or "license" for more information.
>>> import rpm
>>> import yum
>>> print(rpm.__package__, rpm.__file__, rpm.__path__,rpm.__version__)
('rpm', '/usr/lib64/python2.7/site-packages/rpm/__init__.pyc', ['/usr/lib64/python2.7/site-packages/rpm'], '4.11.3')
>>> print(yum.__package__, yum.__file__, yum.__path__,yum.__version__)
('yum', '/usr/lib/python2.7/site-packages/yum/__init__.pyc', ['/usr/lib/python2.7/site-packages/yum'], '3.4.3')
I can't find similar packages (in the ways that I know) for anaconda:
$ source anaconda3/bin/activate python2.7
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
Anaconda is brought to you by Continuum Analytics.
Please check out: http://continuum.io/thanks and https://anaconda.org
>>> import rpm;
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named rpm
>>> import yum
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named yum
>>>
pip and conda search don't seem to have these packages either.
When you run source
anaconda3/bin/activate python2.7
you are running python2.7 using a different virtual environment, where the package repository is different. You should source into the venv and install the packages there.
The problem:
I've installed mapnik 3.0.1 successfully by running the typical source code install:
./configure
make && make install
ldconfig -v
However....
When I import mapnik into python I get the following:
Python 2.7.5 (default, Jun 24 2015, 00:41:19)
[GCC 4.8.3 20140911 (Red Hat 4.8.3-9)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import mapnik
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named mapnik
>>>
I've tried everything recommended on Mapnik's Troubleshooting page by linking library paths, editing ld.so.conf, etc...
I've been trying to figure this out all day, which isn't very productive. I've tried building other versions of mapnik, and the same thing happens. How do I get this imported???
Thanks in advance.
Yea, you need the python bindings, which is a separate thing. As you mentioned they are actually included with mapnik 3.0 but you still haven't registered them (python doesn't know where they are). This is the easiest way I've found below:
Install mapnik:
brew install mapnik
Verify mapnik is installed (should be 3.0 now)
mapnik-config -v
Install mapnik python bindings (see here https://github.com/mapnik/python-mapnik):
git clone git#github.com:mapnik/python-mapnik.git
cd python-mapnik
python setup.py install
I want to install pync on mac for showing notification. I tried with
$ pip install pync
git clone git://github.com/SeTeM/pync.git
cd pync
python setup.py install
sudo easy_install pync
Showing error as :
Last login: Thu Nov 21 12:20:51 on ttys000
fiss-Mac:~ fis$ python
Python 2.7.2 (default, Oct 11 2012, 20:14:37)
[GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from pync import Notifier
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "build/bdist.macosx-10.8-intel/egg/pync/__init__.py", line 3, in <module>
File "build/bdist.macosx-10.8-intel/egg/pync/TerminalNotifier.py", line 99, in <module>
File "build/bdist.macosx-10.8-intel/egg/pync/TerminalNotifier.py", line 27, in __init__
Exception: pync was not properly installed. Head over to https://github.com/SeTeM/pync/ and file a bug.
>>>
You should try pip3 install pync as pip3 works for mac rather than just pip . That is what you should try . If that doesn't work - then you should try to install it from the GitHub link like said in one of the above answers . Hope I was Helpful !! (:
It seems that the package for pync in the Python Package Index does not work properly.
Installing directly from the pync github repo will resolve the issue:
pip install git+https://github.com/SeTeM/pync.git
Just had the same issue.
Unzipping the egg file helped to solve the issue:
cd /Library/Python/2.7/site-packages
sudo unzip pync-1.4-py2.7.egg
sudo rm -r EGG-INFO pync-1.4-py2.7.egg
$ python
Python 2.7.6 (default, Nov 12 2013, 13:26:39)
[GCC 4.2.1 Compatible Apple Clang 4.1 ((tags/Apple/clang-421.11.66))] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from pync import Notifier
>>>
I have a problem with pylibmc on Mac OS Lion.
libmemcached — 1.0.4
pylibmc — 1.2.3
$ python
Python 2.7.1 (r271:86832, Jun 25 2011, 05:09:01)
[GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pylibmc
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Library/Python/2.7/site-packages/pylibmc/__init__.py", line 70, in <module>
import _pylibmc
ImportError: dlopen(/Library/Python/2.7/site-packages/_pylibmc.so, 2): Symbol not found: _memcached_add
Referenced from: /Library/Python/2.7/site-packages/_pylibmc.so
Expected in: flat namespace
in /Library/Python/2.7/site-packages/_pylibmc.so
But it works with sudo!
$ sudo python
Password:
Python 2.7.1 (r271:86832, Jun 25 2011, 05:09:01)
[GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pylibmc
>>>
Any ideas?
Installation in 32-bit mode solved the problem.
You need to install libevent in 32-bit mode
brew install --universal libevent
Next to download libmemcached source (1.0.8 version works for me) and configure force for 32 bit arch:
./configure --build=i386-apple-darwin11.4.2 "CFLAGS=-m32" "CXXFLAGS=-m32" "LDFLAGS=-m32"
make
sudo make install
where 11.4.2 is the version of kernel
Reinstall pylibmc
sudo pip uninstall pylibmc
sudo pip install pylibmc
Now it works
$ python -c 'import pylibmc'
$
Looks like a build and/or installation problem with libmemcached. Maybe you can check out issue #101? https://github.com/lericson/pylibmc/issues/101