PYMC installation --fcompiler not recognized - python

I'm trying to install pymc on OSX Mountain lion.
I have installed gfortran (from http://gcc.gnu.org/wiki/GFortranBinaries#MacOS) and cloned pymc.
I tried what has previously been working: 'setup.py config --fcompiler=gfortran build', but this gives an error:
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: setup.py --help [cmd1 cmd2 ...]
or: setup.py --help-commands
or: setup.py cmd --help
error: option --fcompiler not recognized
If I just do: 'sudo python setup.py install' then I get this
.
.
.
clang: warning: argument unused during compilation: '-mno-fused-madd'
In file included from src/ft2font.cpp:3:
In file included from src/ft2font.h:16:
/usr/X11/include/ft2build.h:56:10: fatal error: 'freetype/config/ftheader.h' file not found
include
^
1 error generated.
error: Setup script exited with error: command 'clang' failed with exit status 1
Any ideas what's going on?
Thanks,
Jen

Which version of PyMC are you trying to install, the current development version on GitHub master (PyMC 3) or the release version (PyMC 2.3)?
If you are trying to install PyMC 3, you do not need a Fortran compiler. You do need Theano, however. Can you try the following?
pip install --no-deps git+git://github.com/Theano/Theano.git
pip install --no-deps git+git://github.com/pymc-devs/pymc.git

Related

Pygraphviz on macOS not installing

I've been trying to install pygraphviz and have followed the following command from another post but it didn't seem to work.
pip install pygraphviz --install-option="--include-path=/Users/ahmedhamadto/PycharmProjects/Kaggle Titanic/venv/lib/python3.10/site-packages/pygments/lexers/graphviz.py" \
--install-option="--library-path=/Users/ahmedhamadto/PycharmProjects/Kaggle Titanic/venv/lib/python3.10/site-packages/pygments/lexers/graphviz.py"
I received the following error:
DEPRECATION: pygraphviz is being installed using the legacy 'setup.py install' method, because the '--no-binary' option was enabled for it and this currently disables local wheel building for projects that don't have a 'pyproject.toml' file. pip 23.1 will enforce this behaviour change. A possible replacement is to enable the '--use-pep517' option. Discussion can be found at https://github.com/pypa/pip/issues/11451
Running setup.py install for pygraphviz ... error
error: subprocess-exited-with-error
× Running setup.py install for pygraphviz did not run successfully.
│ exit code: 1
╰─> [6 lines of output]
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: setup.py --help [cmd1 cmd2 ...]
or: setup.py --help-commands
or: setup.py cmd --help
error: option --include-path not recognized
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure
× Encountered error while trying to install package.
╰─> pygraphviz
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
I need it for the program I am coding in an attempt to make flowcharts:
# Draw and display the fault tree diagram
pos = nx.drawing.nx_agraph.graphviz_layout(G)
nx.draw(G, pos, with_labels=True, node_shape='rectangle')
# Save the diagram to a file
plt.savefig(file_name, format="pdf")

Cython openMP in OSX... no build

I 'm fighting 3 days now to setup my venv...
I need cython, openmp....
My IDE is PyCharm Prof in macOS... I have tried plenty solutions with no result...
when i try to build with PyCharm... the building result is:
UserWarning: Unknown distribution option: 'cmd_class' warnings.warn(msg)
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: setup.py --help [cmd1 cmd2 ...]
or: setup.py --help-commands
or: setup.py cmd --help
error: no commands supplied
so, when i try with:
python setup.py install build_ext --inplace
No build again.... The error is following:
ld: warning: directory not found for option '-L/install/prefix/lib'
ld: warning: -L path '/usr/local/Cellar/llvm/9.0.1/lib/libomp.dylib' is not a directory
ld: warning: directory not found for option '-L/install/prefix/lib'
ld: warning: directory not found for option '-L/usr/local/Cellar/gcc/9/gcc/x86_64-apple-darwin19/9.3.0/include/omp.h'
ld: library not found for -lomp
clang-9: error: linker command failed with exit code 1 (use -v to see invocation)
error: command '/usr/local/opt/llvm/bin/clang++' failed with exit status 1
i have already install:
brew install llvm
brew install libomp
clang version 9.0.1
Target: x86_64-apple-darwin19.3.0
Thread model: posix
InstalledDir: /usr/local/opt/llvm/bin
The setup.py is according to https://cython.readthedocs.io/en/latest/src/userguide/parallelism.html but i have try a lot of differents mods... i am trying to setup 3-days now...
Finally... i know that the compilation is completed with errors. Although if i try to run it... i have the following resutlts... maybe it helps...
ImportError: dlopen(myfile.pyx, 2): Symbol not found: _omp_get_num_threads
Referenced from: myfile.pyx
Expected in: flat namespace
in myfile.pyx.cpython-36m-darwin.so
I 've read somewhere that there is no way to implement in OSX Cython-App with usage of openMP but i m still believe that there is a way...
My system is macOS Catalina 10.15.3 ...
I need your help!!!
Finally i find the solution...
In your venv:
pip install Cython setuptools
Find where is your gcc compiler... if you have already install do as follows, in other case find and install one...
$ mdfind gcc | grep gcc
Put the whole gcc directory in your project's venv.
(path: /My_Project/venv/gcc)
and setup.py should be the following... (path: /My_Project/package/setup.py)
from distutils.core import setup
from distutils.extension import Extension
from Cython.Build import cythonize
from Cython.Distutils import build_ext
import os
os.environ["CC"]="../venv/gcc/9.3.0/bin/gcc-9"
os.environ["CXX"]="../venv/gcc/9.3.0/bin/gcc-9"
ext_modules = [Extension(
"filename",
["filename.pyx"],
language='c',
extra_compile_args=['-fopenmp',"-Os",],
extra_link_args=['-fopenmp', ],
)
]
setup(
name='filename',
cmd_class = {'build_ext': build_ext},
ext_modules= cythonize(ext_modules),
)
Your cython file: filename.pyx ... could starts with a compiler directive comment at the top of filename.pyx as following:
# distutils: extra_compile_args = -fopenmp
# distutils: extra_link_args = -fopenmp
Run in your venv the compilation command:
$ python setup.py build_ext -i
Finally you can import your cython file in your code... at the top of your python file etc. mycode.py :
import filename
filename.myCythonFunc()
The above gives the solution for OSX-10.15.3 macOS Catalina.

Cannot run bdist_wheel build command on my setup.py

I have created a pypi package for educational purposes, and I wanted to do an upgrade. I did through the usual steps(do the changes, run setup.py etc)
but when I do:
python3 setup.py bdist_wheel
I am getting the error
python3 setup.py build bdist_wheel
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: setup.py --help [cmd1 cmd2 ...]
or: setup.py --help-commands
or: setup.py cmd --help
error: invalid command 'bdist_wheel'
Wheel and pip are installed and up to date:
pip3 install wheel
Requirement already satisfied: wheel in /usr/local/lib/python3.4/dist-
packages (0.31.0)
The help of the command, does not seem to support bdist_wheel.
Am I missing something?
python3 setup.py --help-commands
Standard commands:
build build everything needed to install
build_py "build" pure Python modules (copy to build directory)
build_ext build C/C++ extensions (compile/link to build directory)
build_clib build C/C++ libraries used by Python extensions
build_scripts "build" scripts (copy and fixup #! line)
clean clean up temporary files from 'build' command
install install everything from build directory
install_lib install all Python modules (extensions and pure Python)
install_headers install C/C++ header files
install_scripts install scripts (Python or otherwise)
install_data install data files
sdist create a source distribution (tarball, zip file, etc.)
register register the distribution with the Python package index
bdist create a built (binary) distribution
bdist_dumb create a "dumb" built distribution
bdist_rpm create an RPM distribution
bdist_wininst create an executable installer for MS Windows
check perform some checks on the package
upload upload binary package to PyPI
Extra commands:
alias define a shortcut to invoke one or more commands
bdist_egg create an "egg" distribution
develop install package in 'development mode'
easy_install Find/get/install Python packages
egg_info create a distribution's .egg-info directory
install_egg_info Install an .egg-info directory for the package
rotate delete older distributions, keeping N newest files
saveopts save supplied options to setup.cfg or other config file
setopt set an option in setup.cfg or another config file
test run unit tests after in-place build
upload_docs Upload documentation to PyPI
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: setup.py --help [cmd1 cmd2 ...]
or: setup.py --help-commands
or: setup.py cmd --help
EDIT:
python3 --version
Python 3.6.3
pip3 --version
pip 10.0.1 from /usr/local/lib/python3.4/dist-packages/pip (python 3.4)
Looks like pip version and python version didnt match...fixing this removed the problem.

Wheel issue with BigARTM

I am trying to install BigARTM on Ubuntu following the instruction.
Everything goes fine until I run sudo make.
It generates the following error:
[ 99%] Building python package bigartm
running build
running build_py
[ 99%] Built target python_bigartm_build
[100%] Building wheel bigartm
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: setup.py --help [cmd1 cmd2 ...]
or: setup.py --help-commands
or: setup.py cmd --help
error: invalid command 'bdist_wheel'
python/CMakeFiles/python_bigartm_wheel.dir/build.make:57: recipe for target 'python/CMakeFiles/python_bigartm_wheel' failed
make[2]: *** [python/CMakeFiles/python_bigartm_wheel] Error 1
CMakeFiles/Makefile2:781: recipe for target 'python/CMakeFiles/python_bigartm_wheel.dir/all' failed
make[1]: *** [python/CMakeFiles/python_bigartm_wheel.dir/all] Error 2
Makefile:140: recipe for target 'all' failed
I suspected that the problem is connected with wheel. So I updated wheel:
user#user:~/bigartm/build$ pip install wheel
Collecting wheel
Using cached wheel-0.31.0-py2.py3-none-any.whl
Installing collected packages: wheel
Successfully installed wheel-0.31.0
Also I updated wheel in conda, and it shows now:
$ conda list | grep wheel
wheel 0.31.0 py36_0
wheel 0.31.0 <pip>
That did not help.

Unable to install MySQL-python " invalid command 'egg_info' "

I'm getting a weird error after running
$ pip install mysql-python
Has anyone seen an error like this with "egg_info" being invalid?
I'm running OSX mountain lion
Downloading/unpacking MySQL-python
Using download cache from /Users/Marcus/.pip/cache/https%3A%2F%2Fpypi.python.org%2Fpackages%2Fsource%2FM%2FMySQL-python%2FMySQL-python-1.2.4.zip
Running setup.py egg_info for package MySQL-python
Downloading http://pypi.python.org/packages/source/d/distribute/distribute-0.6.28.tar.gz
Extracting in /var/folders/ss/nxvs3w690xqbpvr_l0v31mrw0000gn/T/tmpg_MvY6
Now working in /var/folders/ss/nxvs3w690xqbpvr_l0v31mrw0000gn/T/tmpg_MvY6/distribute-0.6.28
Building a Distribute egg in /Users/Marcus/sites/venv/build/MySQL-python
/Users/Marcus/sites/venv/build/MySQL-python/distribute-0.6.28-py2.7.egg
usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: -c --help [cmd1 cmd2 ...]
or: -c --help-commands
or: -c cmd --help
error: invalid command 'egg_info'
Complete output from command python setup.py egg_info:
Downloading http://pypi.python.org/packages/source/d/distribute/distribute-0.6.28.tar.gz
Extracting in /var/folders/ss/nxvs3w690xqbpvr_l0v31mrw0000gn/T/tmpg_MvY6
Now working in /var/folders/ss/nxvs3w690xqbpvr_l0v31mrw0000gn/T/tmpg_MvY6/distribute-0.6.28
Building a Distribute egg in /Users/Marcus/sites/venv/build/MySQL-python
/Users/Marcus/sites/venv/build/MySQL-python/distribute-0.6.28-py2.7.egg
usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: -c --help [cmd1 cmd2 ...]
or: -c --help-commands
or: -c cmd --help
error: invalid command 'egg_info'
----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /Users/Marcus/sites/venv/build/MySQL-python
Storing complete log in /Users/Marcus/.pip/pip.log
Thanks
--- I'm getting this same error when I run
$ pip install django
You need distribute package which is now inside setuptools:
pip install --upgrade setuptools

Categories