Error installing pymvpa2 with pip - python-2.7

I'm trying to install pymvpa2 in Python 2.7. using pip. I successfully installed other required modules, but I can't install pymvpa2 (I use Python 2.7 and Windows 10).
Also, I downloaded swig, but I keep getting the same error message:
C:\WINDOWS\system32>cd "C:\Python27\Scripts"
C:\Python27\Scripts>pip install pymvpa2
Collecting pymvpa2
Using cached pymvpa2-2.6.1.tar.gz
Complete output from command python setup.py egg_info:
running egg_info
running build_src
build_src
building extension "mvpa2.clfs.libsmlrc.smlrc" sources
building extension "mvpa2.clfs.libsvmc._svmc" sources
creating build
creating build\src.win32-2.7
creating build\src.win32-2.7\mvpa2
creating build\src.win32-2.7\mvpa2\clfs
creating build\src.win32-2.7\mvpa2\clfs\libsvmc
swig.exe++: mvpa2\clfs\libsvmc\svmc.i
swig.exe -python -I3rd\libsvm -c++ -I3rd\libsvm -o build\src.win32-2.7\mvpa2\clfs\libsvmc\svmc_wrap.cpp -outdir build\src.win32-2.7\mvpa2\clfs\libsvmc mvpa2\clfs\libsvmc\svmc.i
error: command 'swig.exe' failed: No such file or directory
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in c:\users\MYCOM\appdata\local\temp\pip-build-uiyfnt\pymvpa2\
Thank you in advance for helping me out!!

pip complains about not finding "swig.exe". Have you checked that you can execute "swig.exe" from the terminal? Simply typing swig or swig.exe should help you find this out. When a command-line program is installed successfully, you can simply type its name in a terminal and it should start.
If swig is not available by this methods, check their special page to get you started on windows: http://www.swig.org/Doc3.0/Windows.html

Related

Python-2.7.18: cryptography-3.3.2 module installation from source failed

I need to install custom module of cryptography#3.3.2 with python-2.7.18 on Ubuntu-18.04, on installation from source got below error
build/temp.linux-x86_64-2.7/_openssl.c: In function '_cffi_d_i2d_re_X509_REQ_tbs':
build/temp.linux-x86_64-2.7/_openssl.c:50709:10: warning: implicit declaration of function 'i2d_re_X509_REQ_tbs'; did you mean 'i2d_re_X509_tbs'? [-Wimplicit-function-declaration]
return i2d_re_X509_REQ_tbs(x0, x1);
^~~~~~~~~~~~~~~~~~~
i2d_re_X509_tbs
=============================DEBUG ASSISTANCE=============================
If you are seeing a compilation error please try the following steps to
successfully install cryptography:
1) Upgrade to the latest pip and try again. This will fix errors for most
users. See: https://pip.pypa.io/en/stable/installing/#upgrading-pip
2) Read https://cryptography.io/en/latest/installation.html for specific
instructions for your platform.
3) Check our frequently asked questions for more information:
https://cryptography.io/en/latest/faq.html
=============================DEBUG ASSISTANCE=============================
error: command 'gcc' failed with exit status 1
----------------------------------------
ERROR: Failed building wheel for cryptography
Failed to build cryptography
ERROR: Could not build wheels for cryptography which use PEP 517 and cannot be installed directly
Current pip version is : pip 20.3.4 (latest supported)
openssl version : OpenSSL 1.1.1
Also all required dependencies are installed.
If
pip install cryptography is done it successfully installs 3.3.2 version.
Kindly suggest.
I tried to install all dependencies but did not solved my problem.
Also attempted to install non patched cryptography-3.3.2 module from source but got the same error.

PyMC installation error with pip

I am attempting to install PyMC using pip install pymc. I believe this command should install PyMC 2.3.6.
PyMC has a few dependencies, which I have in my PATH. I am running OSX 10.11.2 and my PATH includes Python 2.7.13, NumPy 1.12.0, Matplotlib 2.0.0, gcc, and gfortran.
Python (including pip) was installed using Homebrew. NumPy and Matplotlib were installed using pip. The gfortran compiler was downloaded and installed from the GCC Wiki for the purpose of this installation.
Executing pip install pymc yielded lots of output including the following lines.
Collecting pymc
Using cached pymc-2.3.6.tar.gz
Complete output from command python setup.py egg_info:
running egg_info
running build_src
build_src
building extension "pymc.flib" sources
f2py options: ['skip:ppnd7']
f2py:> build/src.macosx-10.11-x86_64-2.7/pymc/flibmodule.c
creating build
creating build/src.macosx-10.11-x86_64-2.7
creating build/src.macosx-10.11-x86_64-2.7/pymc
IOError: [Errno 2] No such file or directory: 'skip:ppnd7'. Skipping file "skip:ppnd7".
updatevars:gradlike: attempt to change 'dimension(nx)' to 'dimension(na)'. Ignoring.
updatevars:gradlike: attempt to change 'dimension(nx)' to 'dimension(nb)'. Ignoring.
updatevars:gradlike: attempt to change 'dimension (nmu)' to 'dimension(nmu)'. Ignoring.
updatevars:gradlike: attempt to change 'dimension (na)' to 'dimension(na)'. Ignoring.
rmbadname1: Replacing "index" with "index_bn".
Reading fortran codes...
Reading file 'pymc/flib.f' (format:fix,strict)
Line #34 in pymc/flib.f:" PARAMETER (infinity = 1.7976931348623157d308)"
get_parameters: got "unexpected EOF while parsing (<string>, line 0)" on ''
...
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/2f/cr97n5v93mn04c3qbqd7r3q40000gn/T/pip-build-6Zmgcz/pymc/setup.py", line 124, in <module>
**(config_dict))
File "/usr/local/lib/python2.7/site-packages/numpy/distutils/core.py", line 169, in setup
return old_setup(**new_attr)
...
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/2f/cr97n5v93mn04c3qbqd7r3q40000gn/T/pip-build-6Zmgcz/pymc/
As suggested in these two pip installation threads about egg_info errors [1, 2], I ran pip install —upgrade setuptools and pip install ez_setup. Once these items were installed I ran into the same types of errors pasted above.
As noted in other package installation threads, I am willing to use conda to install PyMC if I cannot resolve these issues. However, I'd like to investigate this installation issue first.
Would anyone happen to know what my issue is here? Might there be some steps I can take to successfully install PyMC using pip?
I had the same problem. I don't understand the root cause, but I fixed it by downgrading numpy to version 1.10.1: pip install numpy==1.10.1
I also met this problem while trying to install pymc from pip or source code, but I found a solution that might be useful.
The reason that causes the problem might be the file setup.py, in which the script check the compile env. I didn't read the code very carefully, but in the function build_ext() I think the codes first check whether some compile environments have already been installed into OS. If installed, the script will use them as defaults; if not, use ones in somewhere else (the comment says 'from netlib sources').
I infer the problem is caused by the compile environments that have already been installed in the OS, so I modify the file setup.py to skip this part of codes, and let the script use the netlib source. Then I run sudo python setup.py install. There are some error and warning messages, but the folder 'pymc' emerges in python library, and some simple test codes run successfully.

Import Error with certain modules in pyoptsparse

Hello everyone,
I have installed Openmdao, pyOpt and pyoptsparse on my computer. As my program works with the Scipy optimizer, I tried it with a random optimizer of pyoptsparse (that was 'ALPSO'). It worked and I was happy. But it turns out it seems to be the only one working.
Every time I try to use another one (like 'SLSQP', which is the default optimizer !), i get this message "pyOptSparse Error : There was an error importing the compiled SLSQP module", inside a frame made of '-' and '+'.
Does anybody know what to do ? I am using Ubuntu if it changes something.
Thanks to swryan for the link, i found the answer.
One of the possible answer was to put libgfortran.so.3 in anaconda2/lib, but i already had it.
They were also saying the problem was solved when installing anaconda 4.0+ but i also had the latest version.
What worked for me was to run : conda update libgfortran --force
Doing it without the --force retrogrades the scipy, which seems to disable scipy.optimize.least_squares. If you did that, you can then run conda update scipy --force
Did you get any errors when you ran 'python setup.py install' for pyoptsparse? I looked at the setup.py file for pyoptsparse and there are some instructions in there that you could try:
print("\nTo install, run: python setup.py install --user\n\n"
"To build, run: python setup.py build_ext --inplace\n\n"
"For help on C-compiler options run: python setup.py build --help-compiler\n\n"
"For help on Fortran-compiler options run: python setup.py build --help-fcompiler\n\n"
"To specify a Fortran compiler to use run: python setup.py install --user --fcompiler=<fcompiler name>\n\n"
"For further help run: python setup.py build --help"
)

Is there a %config(noreplace) option for setup.py's bdist_rpm?

I am building a python package, and I want to distribute it via rpm using python setup.py bdist_rpm. However, I am including a configuration file, and I want any changes in there to remain if I ever upgrade the RPM on the machine it's installed on. Is there anyway to set a flag in the setup.py script or command that I don't want the RPM to replace the configuration file in case of upgrades? I'm on Python 2.7. Thanks!
python setup.py bdist_rpm --spec-only
This will create dist/*.spec, manually edit it. Especially change:
%install
python setup.py install --single-version-externally-managed -O1 --root=$RPM_BUILD_ROOT --record=INSTALLED_FILES
%files -f INSTALLED_FILES
to:
%install
python setup.py install --single-version-externally-managed -O1 --root=$RPM_BUILD_ROOT
%files
%{python_sitelib}/*
%config(noreplace) %{_sysconfdir}/yourconfig.conf
Note: you may add more lines to %files section, it depends what you put in buildroot. If you miss something rpmbuild from next step will report it as error.
Then you can build the SRPM using
rpmbuild -bs dist/*.spec
More resources can be found here:
https://fedoraproject.org/wiki/Packaging:Python
https://fedoraproject.org/wiki/How_to_create_an_RPM_package

Build Error while converting python file into apk using buildozer

I have made a simple app in python using Kivy and now I want this to be converted into an apk file so that I can use it in my android mobile.
But constantly I am getting following build error while converting it. I am using buildozer for building an apk file.
I have checked for any missing files or directory, but that's not the case. OS : UBUNTU 12.04. The Error is :
[aapt] ~/.buildozer/android/platform/android-sdk-21/platform-tools/aapt: error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory
BUILD FAILED
~/.buildozer/android/platform/android-sdk-21/tools/ant/build.xml:645: The following error occurred while executing this line:
~/.buildozer/android/platform/android-sdk-21/tools/ant/build.xml:683: null returned: 127
Total time: 1 second
.
.
.
assets/private.mp3: /home/manish/kivy/.buildozer/android/app/sitecustomize.pyo
Traceback (most recent call last):
File "build.py", line 412, in <module>
make_package(args)
File "build.py", line 336, in make_package
subprocess.check_call([ANT, arg])
File "/usr/lib/python2.7/subprocess.py", line 511, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['ant', 'debug']' returned non-zero exit status 1
# Command failed: /usr/bin/python2.7 build.py --name 'My Application' --version 1.0 --package org.test.myapp --private /home/manish/kivy/.buildozer/android/app --sdk 14 --minsdk 8 --orientation landscape --window debug
We need to install ia32libs. use " sudo apt-get install ia32-libs " command on ubuntu. I got this question's answer on IRC channel of kivy and it worked for me. Initially i have not installed it as it is for 32-bit system. They said that android tools still require us to download and install ia32-libs on 64bit systems.
This is a fairly generic error that could cover a few different things. Could you paste the full log from buildozer (including with the --verbose option, or log_level = 2 in your buildozer.spec.
You can also do some basic troubleshooting, like check you have the build dependencies installed. I'm not sure which ones could cause this, maybe make sure you have javac (via openjdk probably).
Zlib development package is installed?
You can try:
sudo apt-get install zlib1g-dev
Or some missing packages.