I'm trying to setup a working environment on my mac:
brew install opencv3 --c++11 --with-contrib --with-gphoto2 --with-python3
==> Installing opencv3 from homebrew/homebrew-science
...
==> cmake .. -DCMAKE_C_FLAGS_RELEASE= -DCMAKE_CXX_FLAGS_RELEASE= -DCMAKE_INSTALL
==> make
==> make install
==> Caveats
This formula is keg-only, which means it was not symlinked into /usr/local.
opencv3 and opencv install many of the same files.
Generally there are no consequences of this for you. If you build your
own software and it requires this formula, you'll need to add to your
build variables:
LDFLAGS: -L/usr/local/opt/opencv3/lib
CPPFLAGS: -I/usr/local/opt/opencv3/include
==> Summary
🍺 /usr/local/Cellar/opencv3/3.0.0: 351 files, 110M, built in 5.4 minutes
So homebrew seems to think the install went well, but
locate cv2.so finds nothing...
locate *cv*.so
finds only
/usr/local/Cellar/opencv3/3.0.0/lib/python3.5/site-packages/cv2.cpython-35m-darwin.so
and
/usr/local/lib/python3.5/site-packages/cv2.cpython-35m-darwin.so
cv2.py or cv.py does not exist as well...
Any ideas?
ive seen this error before using raspian, its also seen in ubuntu, renaming cv2.cpython-35m-darwin.so to cv2.so may help fix the issue.
ive heard it just a standard naming error.
Related
I recently deleted the default python version on Fedora 31 and installed python 3.9 then made it as default, now I have multiple versions of python.
If I type: whereis python in my terminal this list appear:
python: /usr/bin/python /usr/bin/python3.9 /usr/bin/python3.7 /usr/bin/python3.9-config /usr/bin/python3.7m /usr/bin/python3.9-x86_64-config /usr/lib/python3.9 /usr/lib/python2.6 /usr/lib/python3.7 /usr/lib64/python3.9 /usr/lib64/python3.7 /usr/local/bin/python3.7m-config /usr/local/bin/python3.7 /usr/local/bin/python3.7m /usr/local/lib/python3.7 /usr/include/python3.9 /usr/include/python3.7m /usr/share/man/man1/python.1.gz /usr/src/Python-3.7.4/python
If I type pip then I get ModuleNotFoundError: No module named 'pip'
Also multiple packages are broken such as dnf, argcomplete, pip, etc.
I cannot update or install anything.
How can I solve this problem ?
Grab/Download the original python RPMs for your distro and reinstall them that way if they're not still cached under /var ....
With Python 3.9 you should use pip3...So install python3-pip.
That should do the trick
I tried many solutions and didn't work, however I ended up backing up my data and completely deleting the OS, then I downloaded the last version of fedora and restored my data on it.
thanks for your time
I ran into this unfortunate situation as well on Fedora 35. dnf, yum, and a bunch of other things broke.
I didn't manage to get Python 3.10 back through dnf, yum, or apt-get. I downloaded the rpm from https://fedora.pkgs.org/35/fedora-x86_64/python3-3.10.0-1.fc35.x86_64.rpm.html. It did require a dependency of python3-libs which I downloaded from: https://fedora.pkgs.org/35/fedora-x86_64/python3-libs-3.10.0-1.fc35.x86_64.rpm.html.
I installed python3-libs first with sudo rpm -i python3-libs-3.10.0-1.fc35.x86_64.rpm --force as there were some file writing conflicts. I ran the same command for the python3.10 rpm with the --force flag as well since there were 2 conflicts. After that, everything worked perfectly! Managed to dodge having to do a full reinstall.
I am trying to install python2 using:
brew install python#2
These are the results I get:
Error: No available formula or cask with the name "pip2".
==> Searching for a previously deleted formula (in the last month)...
Error: No previously deleted formula found.
==> Searching for similarly named formulae...
Error: No similarly named formulae found.
==> Searching taps...
==> Searching taps on GitHub...
Error: No formulae found in taps.
According to my research, python2 was removed from brew. I also ran:
brew search python
I got the following results:
==> Formulae
app-engine-python micropython python#3.9
boost-python python-markdown reorder-python-imports
boost-python3 python-yq wxpython
gst-python python#3.7
ipython python#3.8 ✔
==> Casks
awips-python kk7ds-python-runtime mysql-connector-python
My question is:
Is there another good way to download python2?
You can download the last release of python 2 here but notice that python2 is already in End Of Life state and no longer supported.
You could just download it from the website and use the GUI installer. https://www.python.org/downloads/
I'm doing:
$ brew install subversion --with-python
Yet, homebrew reports:
Warning: subversion: this formula has no --with-python option so it will be ignored!
It goes on to install subversion, as that was only a warning, but I need the Python bindings too.
I tried --with-python in other positions, but it does not make any difference.
Here's all the output:
Warning: subversion: this formula has no --with-python option so it will be ignored!
==> Downloading https://homebrew.bintray.com/bottles/subversion-1.10.2.high_sierra.bottle.tar.gz
Already downloaded: /Users/paul/Library/Caches/Homebrew/downloads/cd34819a835db41e326680b8e94b4343ee0d98f68456b42c03fd1895c77b65c7--subversion-1.10.2.high_sierra.bottle.tar.gz
==> Pouring subversion-1.10.2.high_sierra.bottle.tar.gz
==> Caveats
svntools have been installed to:
/usr/local/opt/subversion/libexec
The perl bindings are located in various subdirectories of:
/usr/local/opt/subversion/lib/perl5
If you wish to use the Ruby bindings you may need to add:
/usr/local/lib/ruby
to your RUBYLIB.
Bash completion has been installed to:
/usr/local/etc/bash_completion.d
==> Summary
🍺 /usr/local/Cellar/subversion/1.10.2: 244 files, 30.4MB
Other info: I'm on macOS 10.13.6. Homebrew was upgraded today (no upgrades pending). There's a info page https://formulae.brew.sh/formula/subversion that suggests that --with-python is a real option, but that's not something the install command agrees with. At least on my computer. Swig is install on my mac (v3.0.12) via brew.
https://formulae.brew.sh/formula/subversion is out of date. The --with-python argument is not supported because the formula does the Python steps by default now.
I'm having a lot of trouble with installing Python 2.7 on the MacOS 10.14 Mojave Beta.
Yes, I know that Python 2 comes pre-installed on the Mac, but I need a framework build of Python for my task.
I've tried re-installing the command line tools and then installing Python 2.7 as suggested here and here, but am still having issues - below is my output:
NickLaptop:~ nicholasarner$ brew reinstall python#2
==> Reinstalling python#2
==> Downloading https://www.python.org/ftp/python/2.7.15/Python-2.7.15.tar.xz
Already downloaded: /Users/nicholasarner/Library/Caches/Homebrew/python#2-2.7.15.tar.xz
==> ./configure --prefix=/usr/local/Cellar/python#2/2.7.15_1 --enable-ipv6 --datarootdir=/usr/l
==> make
==> make install PYTHONAPPSDIR=/usr/local/Cellar/python#2/2.7.15_1
==> make frameworkinstallextras PYTHONAPPSDIR=/usr/local/Cellar/python#2/2.7.15_1/share/python#
==> Downloading https://files.pythonhosted.org/packages/1a/04/d6f1159feaccdfc508517dba1929eb93a
Already downloaded: /Users/nicholasarner/Library/Caches/Homebrew/python#2--setuptools-39.2.0.zip
==> Downloading https://files.pythonhosted.org/packages/ae/e8/2340d46ecadb1692a1e455f13f75e596d
Already downloaded: /Users/nicholasarner/Library/Caches/Homebrew/python#2--pip-10.0.1.tar.gz
==> Downloading https://files.pythonhosted.org/packages/2a/fb/aefe5d5dbc3f4fe1e815bcdb05cbaab19
Already downloaded: /Users/nicholasarner/Library/Caches/Homebrew/python#2--wheel-0.31.1.tar.gz
==> make html
Last 15 lines from /Users/nicholasarner/Library/Logs/Homebrew/python#2/05.make:
return build_main(argv)
File "/usr/local/Cellar/sphinx-doc/1.7.5_1/libexec/lib/python2.7/site-packages/sphinx/cmd/build.py", line 22, in build_main
from sphinx import cmdline
File "/usr/local/Cellar/sphinx-doc/1.7.5_1/libexec/lib/python2.7/site-packages/sphinx/cmdline.py", line 23, in <module>
from sphinx.application import Sphinx
File "/usr/local/Cellar/sphinx-doc/1.7.5_1/libexec/lib/python2.7/site-packages/sphinx/application.py", line 29, in <module>
from sphinx.config import Config
File "/usr/local/Cellar/sphinx-doc/1.7.5_1/libexec/lib/python2.7/site-packages/sphinx/config.py", line 21, in <module>
from sphinx.util import logging
File "/usr/local/Cellar/sphinx-doc/1.7.5_1/libexec/lib/python2.7/site-packages/sphinx/util/__init__.py", line 33, in <module>
from sphinx.util import logging
File "/usr/local/Cellar/sphinx-doc/1.7.5_1/libexec/lib/python2.7/site-packages/sphinx/util/logging.py", line 106, in <module>
class SphinxLoggerAdapter(logging.LoggerAdapter):
AttributeError: 'module' object has no attribute 'LoggerAdapter'
make: *** [build] Error 1
Do not report this issue to Homebrew/brew or Homebrew/core!
These open issues may also help:
python 3.7.0 https://github.com/Homebrew/homebrew-core/pull/29490
python upgrade failing https://github.com/Homebrew/homebrew-core/issues/29214
app-engine-python 1.9.70 https://github.com/Homebrew/homebrew-core/pull/28858
molecule: Use correct `docker` python package dependency https://github.com/Homebrew/homebrew-core/pull/28635
[root] formula does not link against python#2 correctly. https://github.com/Homebrew/homebrew-core/issues/29377
clingo add support for lua, use python 3 https://github.com/Homebrew/homebrew-core/pull/28057
OSError: [Errno 1] Operation not permitted for python#2 –with-tcl-tk https://github.com/Homebrew/homebrew-core/issues/28168
Error: You are using macOS 10.14.
We do not provide support for this pre-release version.
You may encounter build failures or other breakages.
Please create pull-requests instead of filing issues.
Error: You are using macOS 10.14.
We do not provide support for this pre-release version.
You may encounter build failures or other breakages.
Please create pull-requests instead of filing issues
Any help is appreciated!
EDIT Please don't suggest Anaconda! For what I'm working on, I specifically need a framework built version of Python via Brew.
EDIT 2 - I tried reinstalling Sphinx, which happened with no problems. Upon doing that, I tried running install python#2 again, but had the same issue as before.
Below is the output of running brew doctor
NickLaptop:~ nicholasarner$ brew doctor
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry or file an issue; just ignore this. Thanks!
Warning: "config" scripts exist outside your system or Homebrew directories.
`./configure` scripts often look for *-config scripts to determine if
software packages are installed, and what additional flags to use when
compiling and linking.
Having additional scripts in your path can confuse software installed via
Homebrew if the config script overrides a system or Homebrew provided
script of the same name. We found the following "config" scripts:
/Library/Frameworks/Python.framework/Versions/2.7/bin/python2-config
/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7-config
/Library/Frameworks/Python.framework/Versions/2.7/bin/python-config
/usr/local/CrossPack-AVR/bin/libusb-config
Warning: Unbrewed dylibs were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.
Unexpected dylibs:
/usr/local/lib/libFLAC.8.2.0.dylib
/usr/local/lib/libcdt.5.dylib
/usr/local/lib/libcgraph.6.dylib
/usr/local/lib/libcsnd6.6.0.dylib
/usr/local/lib/libfltk.1.1.dylib
/usr/local/lib/libfltk.1.3.dylib
/usr/local/lib/libfltk_forms.1.3.dylib
/usr/local/lib/libfltk_images.1.1.dylib
/usr/local/lib/libfltk_images.1.3.dylib
/usr/local/lib/libfluidsynth.1.dylib
/usr/local/lib/libgraph.5.dylib
/usr/local/lib/libgvc.6.dylib
/usr/local/lib/libgvpr.2.dylib
/usr/local/lib/liblo.0.dylib
/usr/local/lib/libluajit-5.1.2.0.2.dylib
/usr/local/lib/libmpadec.dylib
/usr/local/lib/libpathplan.4.dylib
/usr/local/lib/libpng12.0.dylib
/usr/local/lib/librealsense.1.12.1.dylib
/usr/local/lib/libsfml-audio.2.0.dylib
/usr/local/lib/libsfml-graphics.2.0.dylib
/usr/local/lib/libsfml-network.2.0.dylib
/usr/local/lib/libsfml-system.2.0.dylib
/usr/local/lib/libsfml-window.2.0.dylib
/usr/local/lib/libsndfile.1.dylib
/usr/local/lib/libwiiuse.dylib
/usr/local/lib/libxdot.4.dylib
Warning: Unbrewed header files were found in /usr/local/include.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.
Unexpected header files:
/usr/local/include/graphviz/arith.h
/usr/local/include/graphviz/cdt.h
/usr/local/include/graphviz/cgraph.h
/usr/local/include/graphviz/color.h
/usr/local/include/graphviz/geom.h
/usr/local/include/graphviz/graph.h
/usr/local/include/graphviz/graphviz_version.h
/usr/local/include/graphviz/gvc.h
/usr/local/include/graphviz/gvcext.h
/usr/local/include/graphviz/gvcjob.h
/usr/local/include/graphviz/gvcommon.h
/usr/local/include/graphviz/gvconfig.h
/usr/local/include/graphviz/gvplugin.h
/usr/local/include/graphviz/gvplugin_device.h
/usr/local/include/graphviz/gvplugin_layout.h
/usr/local/include/graphviz/gvplugin_loadimage.h
/usr/local/include/graphviz/gvplugin_render.h
/usr/local/include/graphviz/gvplugin_textlayout.h
/usr/local/include/graphviz/gvpr.h
/usr/local/include/graphviz/pack.h
/usr/local/include/graphviz/pathgeom.h
/usr/local/include/graphviz/pathplan.h
/usr/local/include/graphviz/textpara.h
/usr/local/include/graphviz/types.h
/usr/local/include/graphviz/usershape.h
/usr/local/include/graphviz/xdot.h
/usr/local/include/jack/control.h
/usr/local/include/jack/intclient.h
/usr/local/include/jack/jack.h
/usr/local/include/jack/jslist.h
/usr/local/include/jack/metadata.h
/usr/local/include/jack/midiport.h
/usr/local/include/jack/net.h
/usr/local/include/jack/ringbuffer.h
/usr/local/include/jack/session.h
/usr/local/include/jack/statistics.h
/usr/local/include/jack/systemdeps.h
/usr/local/include/jack/thread.h
/usr/local/include/jack/transport.h
/usr/local/include/jack/types.h
/usr/local/include/jack/uuid.h
/usr/local/include/jack/weakjack.h
/usr/local/include/jack/weakmacros.h
/usr/local/include/librealsense/rs.h
/usr/local/include/librealsense/rsutil.h
/usr/local/include/runt.h
/usr/local/include/sndfile.h
/usr/local/include/soundpipe.h
/usr/local/include/sporth.h
Warning: Unbrewed .la files were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.
Unexpected .la files:
/usr/local/lib/liblo.la
/usr/local/lib/libsndfile.la
Warning: Unbrewed .pc files were found in /usr/local/lib/pkgconfig.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.
Unexpected .pc files:
/usr/local/lib/pkgconfig/jack.pc
/usr/local/lib/pkgconfig/libcdt.pc
/usr/local/lib/pkgconfig/libcgraph.pc
/usr/local/lib/pkgconfig/libgraph.pc
/usr/local/lib/pkgconfig/libgvc.pc
/usr/local/lib/pkgconfig/libgvpr.pc
/usr/local/lib/pkgconfig/libpathplan.pc
/usr/local/lib/pkgconfig/libxdot.pc
/usr/local/lib/pkgconfig/sndfile.pc
Warning: Unbrewed static libraries were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.
Unexpected static libraries:
/usr/local/lib/liblua.a
/usr/local/lib/librunt.a
/usr/local/lib/libsndfile.a
/usr/local/lib/libsoundpipe.a
/usr/local/lib/libsporth.a
Warning: You have unlinked kegs in your Cellar
Leaving kegs unlinked can lead to build-trouble and cause brews that depend on
those kegs to fail to run properly once built. Run `brew link` on these:
lua
libsndfile
ruby
Warning: You are using macOS 10.14.
We do not provide support for this pre-release version.
You may encounter build failures or other breakages.
Please create pull-requests instead of filing issues.
Warning: Broken symlinks were found. Remove them with `brew prune`:
/usr/local/bin/git-remote-keybase
/usr/local/bin/keybase
/usr/local/bin/lua
/usr/local/bin/lua-5.2
/usr/local/bin/lua5.2
/usr/local/bin/luac
/usr/local/bin/luac-5.2
/usr/local/bin/luac5.2
/usr/local/bin/luarocks
/usr/local/bin/luarocks-5.2
/usr/local/bin/luarocks-admin
/usr/local/bin/luarocks-admin-5.2
/usr/local/etc/bash_completion.d/_brew_services
/usr/local/etc/fonts/conf.d/10-hinting-slight.conf
/usr/local/etc/fonts/conf.d/10-scale-bitmap-fonts.conf
/usr/local/etc/fonts/conf.d/20-unhint-small-vera.conf
/usr/local/etc/fonts/conf.d/30-metric-aliases.conf
/usr/local/etc/fonts/conf.d/30-urw-aliases.conf
/usr/local/etc/fonts/conf.d/40-nonlatin.conf
/usr/local/etc/fonts/conf.d/45-latin.conf
/usr/local/etc/fonts/conf.d/49-sansserif.conf
/usr/local/etc/fonts/conf.d/50-user.conf
/usr/local/etc/fonts/conf.d/51-local.conf
/usr/local/etc/fonts/conf.d/60-latin.conf
/usr/local/etc/fonts/conf.d/65-fonts-persian.conf
/usr/local/etc/fonts/conf.d/65-nonlatin.conf
/usr/local/etc/fonts/conf.d/69-unifont.conf
/usr/local/etc/fonts/conf.d/80-delicious.conf
/usr/local/etc/fonts/conf.d/90-synthetic.conf
/usr/local/include/lauxlib.h
/usr/local/include/lua.h
/usr/local/include/lua.hpp
/usr/local/include/lua5.2
/usr/local/include/luaconf.h
/usr/local/include/lualib.h
/usr/local/opt/qt5
Warning: Some installed formulae are missing dependencies.
You should `brew install` the missing dependencies:
brew install harfbuzz mono
Run `brew missing` for more details.
This is the output when running brew config:
HOMEBREW_VERSION: 1.6.9-39-g376f67b
ORIGIN: https://github.com/Homebrew/brew.git
HEAD: 376f67bf2c8893a06bf1e42a2375d58e9d8c2670
Last commit: 2 hours ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: 69b99b69ff3a9c686b9d9fb0102927c5dd2f373b
Core tap last commit: 3 hours ago
HOMEBREW_PREFIX: /usr/local
HOMEBREW_DEV_CMD_RUN: 1
CPU: quad-core 64-bit skylake
Homebrew Ruby: 2.3.3 => /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.3_2/bin/ruby
Clang: 10.0 build 1000
Git: 2.17.1 => /usr/local/bin/git
Curl: 7.54.0 => /usr/bin/curl
Java: 1.8.0_131
macOS: 10.14-x86_64
CLT: 10.0.0.0.1.1529074627
CLT headers: 10.0.0.0.1.1529074627
Xcode: 10.0 => /Applications/Xcode-beta.app/Contents/Developer
XQuartz: 2.7.11 => /opt/X11
I had the same problem.
I was able to fix it by completely uninstalling and reinstalling Python after following step by step in this answer: How to fix broken python 2.7.11 after OSx updates
After the reinstallation the problem was gone
As I read you output - this is not a problem with python directly it is a problem with sphinx which builds the docs. I would go for the following steps:
brew update && brew upgrade
brew install sphinx (maybe this gives a better error message or solves the problem if sphinx is installed before)
brew reinstall python#2
If this is not working: Did you reinstalled the commandline tools after upgrading to mac os 10.14? (xcode-select --install). If not installed/updated before do it and retry.
If this all is not working could you please execute brew doctor and post the output so we can better see whats going on with your homebrew instane?
Maybe it could be a option to make an roll back to a stable version of Mac OS (10.13) ?
I'd suggest you used the Anaconda Distribution of python. Anaconda offers both python 2.7 and python 3.6 with easy to use python installers for both versions. The Anaconda page explains how to install and run python on your mac.
I'm not having much success when attempting building pgmagick on OS X Lion with XCode 4.3.1.
I've installed both ImageMagick and GraphicsMagick, along side boost, using the following commands (via homebrew):
$ brew install graphicsmagick --with-magick-plus-plus
$ brew install imagemagick --with-magick-plus-plus
$ brew install boost --with-thread-unsafe
then I'm cloning the repo at https://bitbucket.org/hhatto/pgmagick:
$ hg clone https://bitbucket.org/hhatto/pgmagick/src
$ cd pgmagick
$ python setup.py build
However I always receive the following error:
ld: library not found for -lboost_python
collect2: ld returned 1 exit status
Based on the output on stdout, setup is looking in the right place for the boost (/usr/local/lib).
I've also tried easy_install and pip but with no luck. I'm using Pythonbrew but have also disabled this and tried using the stock python install -- still no success.
Any suggestions on how I can fix the problem, or further diagnose the issue?
According to my own reproduction of this issue in brew 0.9 and OSX 10.6.8, the problem is --with-thread-unsafe isn't being honored by the current brew formula file. You can verify this by checking the formula with brew edit boost and seeing if the option appears within the contents of the formula.
Because of this, libboost_python-mt.a and libboost_python-mt.dylib are being built instead of libboost_python.a and libboost_python.dylib.
The easiest ways to fix this are to edit your pgmagick setup.py to replace boost_lib="boost_python" with boost_lib="boost_python-mt" (as pointed out here) or to follow the instructions and patch here. It's otherwise a known issue.
The boost_python lib inside /usr/local/lib/ is named after libboost_python-mt.a and libboost_python-mt.dylib, since the default compiling is w/ multi-threads supporting enabled.
Grep boost_lib="boost_python" under ELSE condition in setup.py and replace it w/ boost_lib="boost_python-mt", will fix the "not found" issue.
Also it's OK to ln "-mt" version to libboost_python.a: as described here for linux boost which no longer appends '-mt' suffix since 1.42.
Ignore this line or you could "with-boost-python=boost_python-mt python setup.py install".
You could probably append '--with-boost-python=boost_python-mt' to extra_compile_args inside setup.py, to achieve the same goal.
Furthermore, you could install pgmagick through pip in managed envs. Refs http://rohanradio.com/blog/2011/12/02/installing-pgmagick-on-os-x/
Note that as of July 2014 the boost Python library is a separate homebrew package called boost-python.
5254f8f510fb30484f8fac8be3d38e388a4392e2
Author: Tim D. Smith <git#tim-smith.us>
Date: Sat Jul 19 15:37:25 2014 -0700
Split out Boost.Python
You need to install it separately to get the libboost_python shared library.
Does setting DYLD_FALLBACK_LIBRARY_PATH=/usr/local/lib in the environment help before the build
e.g
$ export DYLD_FALLBACK_LIBRARY_PATH=/usr/local/lib
$ hg clone https://bitbucket.org/hhatto/pgmagick/src
$ cd pgmagick
$ python setup.py build
I've submitted a pull request to homebrew to build Boost with both mt and non mt (threaded and thread unsafe) binaries which are required to build pgmagick.
Turns out this is a rather common problem, until the patch is accepted, you can check out or use my formula for Boost to build pgmagick.