This is the error when trying to run a Python loader function through mclient.
TypeException:user.main[4]:'pyapi3.eval' undefined: Embedded Python 3 has
not been installed. Please install it first, then start server with --set embedded_py=3
When typing monetdb get all I can see that embedpy3 is set to yes because I have already done the -- set embedded_py3=yes.
I have installed monetdb through homebrew on macos.
The homebrew version of MonetDB was built with the option -DPY3INTEGRATION=OFF, in other words, there is no Python integration in the homebrew version.
If you want, you can try to compile it yourself using the homebrew formula after changing that OFF into ON.
As Sjoerd said, the default homebrew build has the CMake option -DPY3INTEGRATION=OFF, which turns off embedded python3 functions.
To install it with this option turned on, you'll need to edit the brew formula and compile it from source (through brew).
First, uninstall the current package:
brew uninstall monetdb
brew cleanup -s monetdb
Then, edit the brew formula:
brew edit monetdb
Find "-DPY3INTEGRATION=OFF" and change it to "-DPY3INTEGRATION=ON"
Finally, install it from source, using the new formula:
brew install -s monetdb
Make sure you have python3 and numpy installed, otherwise it won't work.
NOTE: This still might fail if you have multiple python installations and the one used in the build process does not have numpy installed. In that case, reach out and we'll help you.
Related
This is probably a really dumb question but I am stuck and wasting too much time on this so I would SO appreciate any help.
I am using a RHEL 7 box and installed Apache Zeppelin on it. Everything works except for the life of me I can't import Python packages such as Pandas.
I realized I didn't have PIP so I installed it with these steps: https://pip.pypa.io/en/stable/installing/ (notice I had to use the "--user" argument for the command "python get-pip.py").
Finally, I did "pip install pandas --user" which worked perfectly. I then go into my Zeppelin notebook and I cannot import pandas, even after restarting the Python interpreter.
I did some research and I think the problem is that "which python" and "which pip" are installed in different directories as the former results in "/usr/bin/python" while the latter in "~/.local/bin/pip".
So I suspect the packages installed with pip are basically getting loaded into a different version of python? If it helps, when I do "whereis python" I get 5 different results such as "/usr/bin/python" and "/usr/bin/python2.7" etc.
First thing to understand is: Python packages aren't installed globally, every installed Python has its own set of packages. BTW, pip being a Python package with a script is also not global. If you have a few different pythons you need different pips for them. I don't know Apache Zeppelin so I cannot guess if it uses the system Python (/usr/bin/python) or has its own Python; in the latter case you need to install pip specifically for Zeppelin so its pip install packages available for Zeppelin.
To investigate to what Python pip installs packages you need to find out under what python it runs. Start with shebang:
head -1 `which pip`
The command will prints something like ~/.local/bin/python. If it's not the version of Python you need to install packages for you need to install a different pip using that Python.
The most complex case would be if the shebang is PATH-dependent, something like #!/usr/bin/env python. In that case pip runs Python that you can find with which python.
PS. AFAIK the simplest way to install pip at RedHat is dnf install python-pip.
phd's answer was very helpful but I found that it was just a matter of using the root account to install the python packages. Then my Zeppelin was able to see any packages.
Being new to Python, I'd love to clear up a few points that I couldn't get from reading various articles and tutorials.
After using Homebrew to install Python3, I noticed that it had installed both Python3 and Python3.4. I was also a little surprised that there are now three versions of pip on my machine too; pip, pip3 and pip3.4.
I created a new virtualenv and told it to use Python3, using the following command:
virtualenv -p /usr/local/bin/python3 mysite
I was also surprised that the version of Python that it installed in my VM was 3.4.
Is it safe to have these multiple version of Python and Pip hanging around on my machine?
Am I right to assume that I should take extra care to use the matching version of pip with Python, for example, pip3.4 with Python3.4?
Yes, it is safe. Python uses this naming like python3.4, python3.5 etc to differentiate between releases. python3 is a symbolic link to the current python3.x version. Pip follows the same convention.
If you're using python3.4 explicitly, you should be using pip3.4 specifically as well. Otherwise, just use python3 and pip3. For Python 2, you can simply use python (which, unless you installed the Homebrew version as well), will be the system Python), and ditto for pip. python2.7 and pip2.7 may also work.
In general, to find out which Python version goes with which pip you're using, try:
pip --version
and you'll see the Python included in the result.
No need to worried about if you have multiple version of Python and Pip installed. just check your version by writing in terminal :
$ brew info python
or to check the version of pip write in terminal :
$ brew info pip
and make sure you have updated your both pip and python version (write in terminal $ brew upgrade pip/python)
and other way to install python is go to https://www.python.org/downloads/ and choose as your requirement, there is two version available 2.7.9 & 3.4.3 ,
after installing python write in terminal $ python -V to check its version :) Hope it will help :)
I have installed scipy and numpy, and they are being used with my current, desired version of python 2.7.6 (I am running on OSX Mavericks and had to upgrade.) However, when I pip installed matplotlib, by default it referenced my previous python version, 2.7.5, thus making it troublesome to use (obviously.)
How do I change which version of python matplotlib uses so I can import and use the library?
Thanks.
The way I would solve this problem is like this, firstly one would need to go into your 2.7.6 directory, and under the Scripts folder you will find the pip executable. My suggestion is (because its difficult to debug this kind of people without having all the details) is this:
./pip install matplotlib
And see if this succeeds, otherwise, I suggest using pyenv to manage your python installations.
I suggest you use Macports for installing additional Python versions on OS X. Once Macports is installed, it's fairly easy to install Python 2.7.6. All you'd have to do is:
sudo port install python27
Now, you should be able to get all the libraries you need just as easily, using, too, Macports.
sudo port install py27-numpy
sudo port install py27-scipy
sudo port install py27-matplotlib
Macports should solve all the dependencies and, of course, link the packages to their correct Python versions, avoiding you a lot of headaches.
For a step by step guide on how to set up a nice, functional Python environment, visit: http://jakevdp.github.io/blog/2013/02/02/setting-up-a-mac-for-python-development/
I'm new to Mac's and Python. I want to install an older version of Python (2.5) on to the Mac (OS X 10.8.1).
I'm using homebrew as it's newer than MacPorts and I don't know enough to choose between them.
Following instructions I have installed Rails, mySQL, budle, pow - all sorts of stuff, but when I use the same technique to install python 2.5 it doesn't work.
I tried:
Axolotl:.pow neil$ brew search python25
homebrew/versions/python25
Axolotl:.pow neil$ brew install python25
Error: No available formula for python25
Axolotl:.pow neil$ brew install homebrew/versions/python25
Error: No available formula for python25
Where am I going wrong? Thanks.
python25 is available in the Homebrew-versions tap:
$ brew tap homebrew/versions
$ brew install python25
I think the brew tap homebrew/versions tip is no longer valid...
I have added that to my Homebrew, however it appears to point to this repo: https://github.com/Homebrew/homebrew-versions
...and that does not contain any Python versions.
$ brew search python25
No formula found for "python25".
So if you want to install a specific version other than latest 2.7.x or 3.x.x you need a different method, what worked for me is:
brew install pyenv
(complete the install instructions)
pyenv install 2.5
You can then switch Python versions either globally (default) or just in current shell session, see: https://github.com/yyuu/pyenv
Instead of using brew to install into the entire system a really old version of Python; consider using pythonbrew instead. It will isolate the python install - a bit like virtual environment, but for Python itself.
You're not doing anything wrong, I'm afraid you're just out of luck. Have a look on the list of formulae available: no Python2.5.
There could be a workaround: copy the python.rb gem and edit the lines mentioning a version number, switching from 2.7 to 2.5. Careful with line 31 (the sha1 signature), you'll want to edit that too.
I am trying to install the pycairo (Python bindings for the cairo graphics library) under OSX.
I started with
easy_install pycairo
and got:
Requested 'cairo >= 1.8.8' but version of cairo is 1.0.4
error: Setup script exited with Error: cairo >= 1.8.8 not found
So I went to cairo's site and downloaded the latest package (1.8.8) of cairo, and also the latest package of something called pixman (both source packages -- couldn't find osx binaries)
unzipped both, each in own directory.
for pixman, the regular ./configure ; make ; sudo make install worked just find
for cairo, ./configure seemed to work, but make failed with:
In file included from cairo-analysis-surface.c:37:
cairoint.h:71:20: error: pixman.h: No such file or directory
What am I doing wrong?
And why do I have to struggle so much to get a software library to work on an os that "just works"? Why isn't darwin more like linux?
If you already have homebrew, these two commands should be helpful:
$ brew install cairo --use-clang
$ brew install py2cairo
For a non-Homebrew installed Python, set the PYTHONPATH to find pycairo. You can set your PYTHONPATH in your .bashrc/.profile/.whatever to the following:
PYTHONPATH=/usr/local/lib/python2.7/site-packages:$PYTHONPATH.
I personally didn't need to use this last part but it might help you.
It appears you are mixing various install options here. The MacPorts package system port install command should automatically pull in all the dependencies needed for a particular package so the trick is to start with the right top-level project. For python packages, MacPorts has a general convention currently: packages that start with py- are for python 2.4, those with py25- are for 2.5, and py26- for 2.6. There are currently py-cairo, py25-cairo, and py26-cairo packages available in MacPorts.
By choosing py-cairo you picked the python2.4 version and you'll probably find that MacPorts built and installed a python2.4 for you (linked at /opt/local/bin/python2.4) and, if you launch it, you'll probably find that you can import cairo there. Now that may be OK for your needs but Python 2.4 is quite old and no longer supported so, if you're just starting, it might be better to start with Python 2.6, one of the two current versions of Python. To do so, all you should need to do is:
sudo port install py26-cairo
That should bring in any missing dependencies, mainly the MacPorts python2.6, which you can run from /opt/local/bin/python2.6. You may want to change your $PATH in your shell startup script, probably .bash_profile, to put /opt/local/bin early on the search path.
Because installing Cairo and its python bindings seems to be fairly complex, it should be easier and better to stick to using a complete MacPorts solution for this. That does mean you've needlessly (and harmlessly) installed a couple of Python instances that you won't need. But if you do want to clean things up a bit, you can easily remove the MacPorts python24 with:
sudo port uninstall py-cairo python24
Completely removing the python.org installed python is more complicated. I've explained the process here. But there's no pressing need to remove either as long as you keep your paths straight.
Ok. I solved it. Putting solution here for future reference, it might help someone.
Basically, the whole ports/fink system is a bit messed up, and osx doesn't really play nice with the linux-y world.
So, the steps I needed to install pycairo on OSX were:
download the latest source versions of pixman, cairo, pycairo
extract everything. Then:
cd PIXMAN_DIR ; ./configure ; make ; sudo make install
cd CAIRO_DIR ; cp PIXMAN_DIR/pixman/*.h . ; ./configure ; make ; sudo make install
cd PYCAYRO_DIR; locate cairo.pc
hopefully, several locations are returned. choose the most likely one (one with newest cairo). For me it was "/opt/local/lib/pkgconfig/cairo.pc" and do:
export PKG_CONFIG_PATH=/opt/local/lib/pkgconfig/
after this, still in PYCAIRO_DIR, do:
python setup.py install
This should do it...
The port command installs the library for the darwinports python installation, which is different to the framework build (so steps 2 and 3 shouldn't work). Try sudo easy_install pycairo instead (although your step 4 should be equivalent to this).
Look at which python too, to check that you are in fact running the python you think you are.
On Mac OS you can have multiple Python versions installed. You can have even more if you decide to install Python via Fink or MacPorts. When you compile libraries from the source, you should make sure they point to the correct installation.
I currently have Python 2.5.1 and Python 2.6.4 installed on my machine, which I can call via python2.5 and python respectively. They live in two different folders:
/System/Library/Frameworks/Python.framework/Versions/2.5and /Library/Frameworks/Python.framework/Versions/2.6
I was running into a similar problem when compiling pycairo 1.8.8 from the tarball. The INSTALL file in this case is your friend, as it contains the correct instructions to avoid potential version conflicts. You basically need to specify the correct prefix so that the package will be installed in the correct folder.
$ python -c "import sys; print sys.prefix"
# make a note of the python prefix
$ ./configure --prefix=[python_prefix]
$ make
$ make install # may require superuser access
Running these instructions with python2.5 and python you will be able to correctly install pycairo for both versions (or for any version installed via MacPorts / Fink).
Step 1: Run this from terminal ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" < /dev/null 2> /dev/null
Step 2: brew install cairo
Step 3: pip install pycairo