adding python binary distribution to path - python

I am trying to get the python package simms to work on my computing cluster. Unfortunately there isn't much documentation. I have
inside my conda env installed it via
pip install simms
I also git cloned https://github.com/ratt-ru/simms.git to
my_dir/simms
Then inside my conda env, running the suggested:
python my_dir/simms/tests/tests.py
gives an error
FileNotFoundError: [Errno 2] No such file or directory:
'casa': 'casa'
I have filled the instructions at
https://github.com/ratt-ru/simms/blob/master/tests/test.py to install the
CASA package (from https://casa.nrao.edu/installlinux.shtml) . After
uploading and unzipping, I added it to my path variable with
export PATH=$PATH: mydir/casa-6.5.2-26-py3.8
Note that casa-6.5.2-26-py3.8 has a subfolder bin/ so things Python should know where to look, but I still get the same FileNotFoundError.

Related

Cannot locate the .so file in a package installed from git

I am trying to install a python package from gitlab. I am using pip install git+gitlab_package_address, like here. After that, I am able to import the package. But the package comes with an .so file and later it throws an error: OSError: $LD_LIBRARY_PATH/lib{that_package}.so: cannot open shared object file: No such file or directory.
Manual trial: I can clone the repo via SSH and move into the repo directory. Compile to get the desired lib{that_package}.so (checked that it exists using ls) and using export LD_LIBRARY_PATH=/absolute/path/to/the/repo/directory. Still the same error.
Any help is appreciated.

Getting an error "GitCommandNotFound: Cmd('git') not found due to:" in Anaconda Spyder

Im Trying to clone a git repo using the GitPython in spyder.
im using the below code.
from git import Repo
full_local_path = r'C:/New/Newfolder'
remote = f"https://(git path)/*/frontend_backup.git"
Repo.clone_from(remote, full_local_path)
But im getting an error
GitCommandNotFound: Cmd('git') not found due to: FileNotFoundError('[WinError 2] The system cannot find the file specified')
cmdline: git clone -v https://(git path)/*/frontend_backup.git C:/New/Newfolder
The same command when executed in Anaconda Prompt, is getting executed successfully, but when tried to do the same in Spyder , getting such error.
Note: I have given the PATH for git.exe and python.exe in system variables.
Found the answer.
Its because the anaconda environment(base) in which i was using the Spyder hadn't installed the git versions.
The base env, doesnt let you install extra packages, you have to create another env and install all the packages needed.
i created another env in anaconda and it solved the error.

Error: setup script specifies an absolute path: .gitignore

On Ubuntu 16.04.4, I suspect some recent update of some Python system package of having broken my Python 2.7 configuration. Whatever package I try to install or reinstall with a basic sudo python setup.py install it always fails because of gitignore:
running install
running bdist_egg
running egg_info
[...]
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
error: Error: setup script specifies an absolute path:
/home/me/some_repo/.gitignore
setup() arguments must *always* be /-separated paths relative to the
setup.py directory, *never* absolute paths.
Lately I found a temporary workaround by manually cleaning the /usr/local/lib/python2.7/dist-packages/some_package directory manually before installing some_package. However tonight I'm facing the same issue on another repository and it keeps failing whatever I clean up. I also tried cleaning all compiled folders .egg-info/ build/ dist/ without success.
Notes: The setup script does not actually specify an absolute path to gitignore. An example of failing repo is https://github.com/philchristensen/python-artnet/blob/master/setup.py This repo has a setuptools_git entry which might lead to a clue, but other packages without this git entry point also fail because of the gitignore while a couple of months ago I never faced such issue with the same repos. Deleting the gitignore causes the setup to fail because of another non-py local file.
Any clue?
It looks like some other package that I had previously installed broke my system-wide Python.
Here's how I fixed in order to install package xyz:
Browsed /usr/local/lib/python2.7/dist-packages in search for occurences of "gitignore"
Deleted folders of all matching occurences (including setuptools_git itself that matches "gitignore")
pip install setuptools_git
In package xyz, rm -rf dist/ build/ *.egg-info/
Reinstall package xyz, which now succeeds to install
Use virtual envs as a lesson

virtualenv error: "'.../bin/easy_install' not found"

using python3.3 on OS X 10.7.5
when i run
virtualenv-3.3 virtualenv/
it errors on
FileNotFoundError: [Errno 2] No such file or directory: '.../virtualenv/bin/easy_install'
after
Overwriting virtualenv/lib/python3.3/site.py with new content
Overwriting virtualenv/lib/python3.3/orig-prefix.txt with new content
Overwriting virtualenv/lib/python3.3/no-global-site-packages.txt with new content
New python executable in virtualenv/bin/python3.3
Not overwriting existing python script virtualenv/bin/python (you must use virtualenv/bin/python3.3)
Overwriting virtualenv/lib/python3.3/distutils/__init__.py with new content
File virtualenv/lib/python3.3/distutils/distutils.cfg exists with different content; not overwriting
Installing distribute...done.
Installing pip...
my system has setuptools / distribute.
why isn't virtualenv setting up easy_install?
This issue is related to having an outdated version of Pip, I think.
I got a similar error on CEntOS 6.3.
I suggest at least attempting to bootstrap a virtual environment. If it doesn't work, all you have to lose are some megabytes and a 20 minutes of your time.
What you will need:
Compiled Python3.4
Source of the latest VirtualEnv
Fortitude
Pen and paper
Something similar to the answer outlined here might work: What's the proper way to install pip, virtualenv, and distribute for Python?
In short, download the virtualenv package from source from PyPI, extract it, and cd into the directory created by the extraction.
From the documentation:
$ curl -O https://pypi.python.org/packages/source/v/virtualenv/virtualenv-X.X.tar.gz
$ tar xvfz virtualenv-X.X.tar.gz
$ cd virtualenv-X.X
Replace the X.X above with the version number. For example, cd virtualenv-X.X would, after replacing the Xs with the right version number, be cd virtualenv-13.1.2.
Then, use virtualenv.py from there, not just $ virtualenv, but $ ./virtualenv.py.
I hope that this would work much better, since pip with the latest virtualenv will include easy_install in the expected location.
I have tested this on a CEntOS 6.3 machine with a similar configuration. It works on there, but I cannot afford a copy of OS X 10.7.5.

How to change path to site-packages dir in easy_install

I'm trying to use easy_install on windows7x64 and getting this:
<output>
c:\Python27\Scripts>easy_install.exe django-piston
error: can't create or remove files in install directory
The following error occurred while trying to add or remove files in the
installation directory:
[Errno 2] No such file or directory: 'C:\\Python27\\Lib\\site-packages\\Lib\
\site-packages\\test-easy-install-4132.pth'
The installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:
C:\Python27\Lib\site-packages\Lib\site-packages\
This directory does not currently exist. Please create it and try again, or
choose a different installation directory (using the -d or --install-dir
option).
Where can I change easy_install's path to correct one "C:\Python27\Lib\site-packages"?
easy_install should install the packages in the Python installation's site-packages directory. It could have happened that you changed Python's directory accidentally.
Reinstalling easy_install should fix this.
Otherwise you could use:easy_install --install-dir C:\Python27\Lib\site-packages\Lib\site-packages\ django-piston
However, this last option has two issues:
Make sure C:\Python27\Lib\site-packages\Lib\site-packages\ is in PYTHONPATH
You will need to indicate a install-dir directory for every new package you install

Categories