Here's the problem: after a lot of struggle I managed to instal pybrain, but it runs only from terminal when I use the command export 'PYTHONPATH=$PYTHONPATH:'. When I try to import modules and write in Python (through anaconda) I get this error 'no module named pybrain'. It's as if Anaconda couldn't see that pybrain is right there. Could it be a problem with the directory?
I don't understand what it means:
"Change into the directory Pybrain directory after either checking out got or downloading and extracting the archive. There you run (possibly as a superuser on Unix systems):
$ python setup.py install"
which I found on 'http://pybrain.org/docs/quickstart/installation.html'
Use the following command to install it properly to Anaconda:
pip install -i https://pypi.binstar.org/pypi/simple pybrain
That should work. The process to find out why is lengthy, and I'll follow up soon.
Proof:
One of the issues could be that it's not permitting you to install this module.
Try this in your PyBrain directory:
sudo python setup.py install
EDIT:
To navigate within terminal to the directory you use the cd - command. Let's say PyBrain is located in your desktop:
$ (this is where you'll be initially on your terminal)
EDIT 2:
To be in your root directory to be able to navigate to any file use the ../ command until you are there (it's appear as a house on your terminal window):
$ cd ../
$ cd ../
Then navigate to the directory:
$ cd desktop/pyBrain
Or in your case:
$ cd anaconda/lib/python3.4/site-packages/pybrain-master
Further documentation about installation can be found here: https://github.com/pybrain/pybrain/wiki/installation
EDIT 3:
Removing Anaconda:
rm -rf ~/anaconda
The rm command will remove the file, and the rf will force it to be deleted (otherwise it might not delete the directory).
Related
I'm new to python, and I was wondering if you could help me run a python script. I'm trying to run a script called PunchBox from Github: https://github.com/psav/punchbox. So far, I have Python 3.9.5 and Git Bash.
In the GitHub page, it says:
To install, clone the repo, cd into it and then execute the following:
virtualenv -p python2 .pb2
source .pb2/bin/activate
pip install -U pip
pip install .
What does this mean exactly? Where do I run this code?
So far, I tried downloading the zip file from GitHub, installing Python 3.5.9, using cmd, finding the directory with cd, and running that code; but got an error:
Exception: Versioning for this project requires either an sdist tarball, or access to an upstream git repository. It's also possible that there is a mismatch between the package name in setup.cfg and the argument given to pbr.version.VersionInfo. Project name punchbox was given, but was not able to be found.
error in punchbox setup command: Error parsing C:\Users\Mi\Downloads\punchbox-master\punchbox-master\setup.cfg: Exception: Versioning for this project requires either an sdist tarball, or access to an upstream git repository. It's also possible that there is a mismatch between the package name in setup.cfg and the argument given to pbr.version.VersionInfo. Project name punchbox was given, but was not able to be found.
There's also a requirements.txt that lists additional scripts needed:
pre-commit
click
mido
pbr
PyYAML
svgwrite
Do these install automatically upon running the script for the first time?
I'm a little confused why I'm getting an error. Do you know what I'm doing wrong?
Thank you so much!
Giovanni
I assume you are new to programming. You have to write these lines in a terminal.
On Windows, it is Command Prompt or PowerShell Applications (latter preferred). On macOS, it is terminal
Copy all these lines at once, and paste them to your preferred terminal. The terminal will automatically run these one after the another.
FYI: Venv is a python package to create a virtual environment. The preceding commands set up the environment. Now install the required dependencies using this command instead of the last command (pip install .)
pip install -r requirements.txt
Based on your comment, it looks like you don't have virtualenv installed in your system. You may install it using the command pip install virtualenv.
Now, as you are using a Windows machine, you may open a Command Prompt or Windows PowerShell window and navigate to the directory where your cloned project resides.
Now, execute the following commands.
virtualenv -p python2 .pb2
.pb2\Scripts\activate.bat
pip install -U pip
pip install -r requirements.txt
Once you are done working in your virtual environment (which is named .pb2), you may close it by executing deactivate command.
#Giovanni T.
See, as far as you have installed Python and also downloaded the GitHub Repository as a zip file.
pip install -r requirements.txt
Just run this command.
Please make sure that the directory is pointing to the folder where this requirements.txt file is stored.
I added the pip installation folder in my python site-packages directory to my PATH, but I can still only run it via python -m pip in my git bash. Just pip gives me command not found.
I looked around the pip directory and I don't see any binaries, so this makes sense. Yet clearly pip is a thing that is normally used on the command line without python -m. So what component am I missing here?
Try adding C:/path/to/python/Scripts/ to PATH
There should be a pip.exe there!
in your Anaconda directory there is a pip file in the direcctory Scripts.
add this path : C:\Users#yourname\Anaconda3\Scripts
i did the same and it was successful !!
(when i wrote pip in git bash it worked)
I tried to install xgboost on python thanks to the following instruction:
I – Install MinGW Get the installer online :
https://sourceforge.net/projects/mingw-w64/
When installing, select 'Architecture' x86_64.
After the install procedure is completed, add the binaries path to your PATH
environment variable: directory can be something like
C:\Users\username\mingw-w64\x86_64-5.3.0-posix-seh-rt_v4-rev0\mingw64\bin
How to: change PATH variable on windows:
https://www.java.com/fr/download/help/path.xml
Help on errors: If you have another error in the install procedure,
get it from here
https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Personal%20Builds/mingw-builds/5.3.0/threads-posix/seh
Extract the file with 7zip in the directory of your choice (preferably
C:\Users\username\mingw64). Add the binaries path to your PATH
environment variable: C:\Users\username\mingw64\bin
II – Install Git https://git-scm.com/download/win and run the
installer
III – Install XGBoost on your computer open git bash shell in Windows,
and execute the following commands one by one:
cd your_folder_for_xgboost https://github.com/dmlc/xgboost
cd xgboost git checkout 9a48a40 # This line is based on https://github.com/dmlc/xgboost/issues/1267
git submodule init
git submodule update alias
make='mingw32-make'
cp make/mingw64.mk config.mk
make -j4
IV – Install XGBoost on python In the anaconda command prompt:
cd your_folder_for_xgboost/xgboost/python-package python setup.py install
All works well until the last command, there was an error that I don't understand how to resolve it. I tried to do it the second time but I still have the same error. I also tried to do the same thing on 2 different PCs and I had the same error message.
Possible issues and solutions:
The name of the MinGW64 installation folder shouldn`t have space. Therefore I do not recommend to install it by default in "Program Files".
You should restart your session (or even PC) after PATH editing.
Find mingw32-make.exe in MinGW64 folder and copy it again to this folder with renaming to make.exe. You can use make='mingw32-make' but I do not recommend it.
~Install GIT and XGBoost~
git clone --recursive https://github.com/dmlc/xgboost
cd xgboost
git submodule init
git submodule update
cp make/mingw64.mk ./config.mk
Exec make -j4. If you can find xgboost.exe in XGBoost folder, then you did all right. If you get an error unrecognized option '-pthread', open (for editing) file Makefile in XGBoost directory, find -pthread in it and add L letter before (-lpthread)
After that you can execute:
cd python-package
python setup.py install
Do not forget that your Python should have installed 'setuptools'. Or you can just install Anaconda package with all utils (I recommend this way).
I installed python with homebrew and installed pyvisa with pip, now when I run import visa, I got the following error:
OSError: dlopen(/usr/local/vxipnp/linux/bin/libvisa.so.7, 6): image not found
It seems like it's looking for NI-VISA at wrong location, how can I fix this?
On the pyvisa website FAQ it says
Error: Image not found
This error occurs when you have provided an invalid path for the VISA library. Check that the path provided to the constructor or in the configuration file
But how do I check the path?
The file that needs modification is vpp43.py.
However, the packages of PyVISA installed from 'pip' or 'easy_install' on Mac OS will be installed under .egg file:
$ /Library/Python/2.7/site-packages/PyVISA-1.5.dev4-py2.7.egg
I could not find a way to modify this, therefore I recompiled the original code by downloading it in a given director
$ mkdir pyvisacode
$ cd pyvisacode
$ curl -OL https://github.com/hgrecco/pyvisa/tarball/master
When it is downloaded extract it by
$ tar -zxvf master
A file will be created in the same directory. Navigate to
$ cd hgrecco-pyvisa-4cbdbc9/pyvisa/legacy
and run Xcode or any other text editor
$ open -a Xcode vpp43.py
In the opened vpp43.py find
path = "/usr/local/vxipnp/linux/bin/libvisa.so.7"
Comment this line and replace it with
#path = "/usr/local/vxipnp/linux/bin/libvisa.so.7"
path = "/Library/Frameworks/visa.framework/visa"
Now you can install PyVISA by
$ cd ../../
$ sudo python setup.py install
Don't forget to run your python in 32 bit. More details can be found here http://bardagjy.com/?p=1245.
I hope this will be fixed in the next PyVISA update!
Good luck
i'm trying to install a library for python of gene ontology programming [GOGrapher]. In the page they told me this:
$ `svn co https://projects.dbbe.musc.edu/public/GOGrapher/trunk GOGrapher`
$ cd GOGrapher
$ su -
# python setup.py install
I do everything, but in the last step a get an error
error: /usr/local/lib/python2.7/dist-packages/GOGrapher-0.0.egg-info: Permission denied
What is wrong? I'm new on this, but I do what I can.
Try
sudo python setup.py install
instead. (Works for me on Mac OS 10.7.3, while the suggested su - solution doesn't).
It is not a good idea to install things as superuser in the filesystem. In Python you can always install libraries locally.
Assuming you are already in GOGrapher directory:
$ python setup.py install --home
should install the library in your home directory. Later, you have to add the library PATH to the PYTHONPATH environment variable, so Python will know where to search for it.
$ export PYTHONPATH=$HOME/lib/python
The directory might be slightly different (lib/python2.7 or even lib/python2.7/site-packages), you can check it, tough.
To make it permanent, you should add it in your .profile, .bashrc, or whatever is the shell you are using.