How to install pybrain - python

I am attempting to install pybrains but I am getting this error:
C:\Python34\python.exe "C:\Program Files (x86)\JetBrains\PyCharm Community Edition 4.0.4\helpers\pycharm\pycharm_setup_runner.py" C:\Users\PycharmProjects\Youtube\pybrain-pybrain-87c7ac3\setup.py
Testing started at 14:08 ...
running pycharm_test
running egg_info
writing PyBrain.egg-info\PKG-INFO
writing dependency_links to PyBrain.egg-info\dependency_links.txt
writing top-level names to PyBrain.egg-info\top_level.txt
reading manifest file 'PyBrain.egg-info\SOURCES.txt'
writing manifest file 'PyBrain.egg-info\SOURCES.txt'
running build_ext
Traceback (most recent call last):
File "C:\Program Files (x86)\JetBrains\PyCharm Community Edition 4.0.4\helpers\pycharm\pycharm_setup_runner.py", line 26, in <module>
exec (fh.read(), globals(), locals())
File "<string>", line 21, in <module>
File "C:\PYTHON34\LIB\distutils\core.py", line 148, in setup
dist.run_commands()
File "C:\PYTHON34\LIB\distutils\dist.py", line 955, in run_commands
self.run_command(cmd)
File "C:\PYTHON34\LIB\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "C:\Python34\lib\site-packages\setuptools\command\test.py", line 138, in run
self.with_project_on_sys_path(self.run_tests)
File "C:\Python34\lib\site-packages\setuptools\command\test.py", line 118, in with_project_on_sys_path
func()
File "C:\Program Files (x86)\JetBrains\PyCharm Community Edition 4.0.4\helpers\pycharm\pycharm_commands\pycharm_test.py", line 18, in run_tests
testLoader=loader_class()
File "C:\PYTHON34\LIB\unittest\main.py", line 92, in __init__
self.parseArgs(argv)
File "C:\PYTHON34\LIB\unittest\main.py", line 139, in parseArgs
self.createTests()
File "C:\PYTHON34\LIB\unittest\main.py", line 146, in createTests
self.module)
File "C:\PYTHON34\LIB\unittest\loader.py", line 146, in loadTestsFromNames
suites = [self.loadTestsFromName(name, module) for name in names]
File "C:\PYTHON34\LIB\unittest\loader.py", line 146, in <listcomp>
suites = [self.loadTestsFromName(name, module) for name in names]
File "C:\PYTHON34\LIB\unittest\loader.py", line 105, in loadTestsFromName
module = __import__('.'.join(parts_copy))
File "c:\users\dhowarth\pycharmprojects\youtube\pybrain-pybrain-87c7ac3\pybrain\__init__.py", line 1, in <module>
from structure.__init__ import *
ImportError: No module named 'structure'
Process finished with exit code 1
Where do I find the 'Structure' module?
Anyone having the same issue?
I have followed the instructions on: https://github.com/pybrain/pybrain/wiki/installation.
what am I missing?

The Pybrain can be setup by pip install pybrain directly.
The FNN in pybrain have a bit problem of convergence and performance. As substitution, there are lots of advices on Python for AI, such as FANN (An example) and scikit-learn (for lots of ML method but not contains FNN directly).

Try not to use pip. I always prefer getting the entire folder from PyPI or github (if available) and then doing the simple python setup.py install.
Also, whenever you do some work with the packages which are under active development (or not very commonly use), please read their documentation.
If you see the documentation : Here. You will see that they use Python 2.x.
And you are clearly using Python 3.x.
Get Python 2.x and download the folder from github. Unzip it and install.
Hope it helps.
Cheers.

Try following queries:
pip install numpy
pip install scipy
pip install pybrain
OR:
download ez_setup.py and run it:
python ez_setup.py
OR:
use easy_install:
easy_install pybrain

Related

Py2Exe - Addressing NumPy and SciPy dependencies

Objective (End-Goal):
I want to create a stand-alone executable Python script (only one file) that includes NumPy and SciPy dependencies for my application.
Background:
From my understanding, to create an executable script in Python - there are three options that are available:
PyInstaller
Py2exe
CxFreeze
I went ahead and tried Py2exe for my development. It appears that CxFreeze does not support the single-file option (from the documentation here). I also considered the option of using PyInstaller, but ran into issues regarding missing DLLs (similar to what is found here). The issue continued to persist even after installing the Microsoft Visual C++ 2010 Redistributable Package in my laptop.
I followed the tutorial to use Py2exe here and was able to get a dummy script executable (Hello World!) working. However, I tried to re-modify the setup.py script specific to my application to include numpy and scipy dependencies (see below):
from distutils.core import setup
import py2exe,sys,numpy,scipy
sys.argv.append('py2exe')
setup(
console=['Application.py'],
options={
'py2exe': {
'includes':['numpy','scipy','scipy.integrate','scipy.special.*','scipy.linalg.*'],
'bundle_files':1,
'compressed':True
}
},
zipfile=None)
This is the resulting error I received when I tried running the script:
Traceback (most recent call last):
File "C:\Program Files\JetBrains\PyCharm 2018.1.4\helpers\pydev\pydev_run_in_console.py", line 52, in run_file
pydev_imports.execfile(file, globals, locals) # execute the script
File "C:\Program Files\JetBrains\PyCharm 2018.1.4\helpers\pydev\_pydev_imps\_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "C:/Users/prest/PycharmProjects/Application/setup.py", line 15, in <module>
zipfile=None
File "C:\Python34\lib\distutils\core.py", line 149, in setup
dist.run_commands()
File "C:\Python34\lib\distutils\dist.py", line 955, in run_commands
self.run_command(cmd)
File "C:\Python34\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "C:\Users\prest\PycharmProjects\Application\venv\lib\site-packages\py2exe\distutils_buildexe.py", line 188, in run
self._run()
File "C:\Users\prest\PycharmProjects\Application\venv\lib\site-packages\py2exe\distutils_buildexe.py", line 267, in _run
builder.analyze()
File "C:\Users\prest\PycharmProjects\Application\venv\lib\site-packages\py2exe\runtime.py", line 164, in analyze
mf.import_hook(modname)
File "C:\Users\prest\PycharmProjects\Application\venv\lib\site-packages\py2exe\mf3.py", line 120, in import_hook
module = self._gcd_import(name)
File "C:\Users\prest\PycharmProjects\Application\venv\lib\site-packages\py2exe\mf3.py", line 274, in _gcd_import
return self._find_and_load(name)
File "C:\Users\prest\PycharmProjects\Application\venv\lib\site-packages\py2exe\mf3.py", line 337, in _find_and_load
raise ImportError(name)
ImportError: scipy.linalg.*
These are the versions that I am using relevant for my application:
Python 3.4
NumPy 1.14.5
SciPy 1.1.0
Question:
Can anyone provide any insight as to why I am receiving this error and any next steps to address this? I appreciate any input!
Thanks,
Preston
Closing - went ahead and use PyInstaller for the single-file executable. I re-modified my script to address specific dependencies (only used NumPy).

How can I install GDAL in Ubuntu 16,04 with python 2.7.12 using pip?

I am trying to import some specific libraries using python. it should be easy like importing numpy for example like so:
import osgeo.gdal, gdal
from osgeo.gdalconst import *
But it seemed to me like the packages gdal and osgeo are missing so I went to the project interpreter to add these packages, Sadly i did not find the package osgeo and the package gdal could not be installed ... I looked it up in the net but it seems that there is no exact way to solve the matter.
I am using Ubuntu 16,04 with python 2.7.12 and PS GDAL is Geospatial Data Abstraction Library
This the error message that I am getting:
Collecting gdal
Using cached GDAL-2.2.3.tar.gz
Complete output from command python setup.py egg_info:
running egg_info
creating pip-egg-info/GDAL.egg-info
writing pip-egg-info/GDAL.egg-info/PKG-INFO
writing top-level names to pip-egg-info/GDAL.egg-info/top_level.txt
writing dependency_links to pip-egg-info/GDAL.egg-info/dependency_links.txt
writing manifest file 'pip-egg-info/GDAL.egg-info/SOURCES.txt'
warning: manifest_maker: standard file '-c' not found
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pycharm-packaging347/gdal/setup.py", line 339, in <module>
**extra )
File "/usr/lib/python2.7/distutils/core.py", line 151, in setup
dist.run_commands()
File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands
self.run_command(cmd)
File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "build/bdist.linux-x86_64/egg/setuptools/command/egg_info.py", line 180, in run
File "build/bdist.linux-x86_64/egg/setuptools/command/egg_info.py", line 207, in find_sources
File "build/bdist.linux-x86_64/egg/setuptools/command/egg_info.py", line 291, in run
File "build/bdist.linux-x86_64/egg/setuptools/command/egg_info.py", line 320, in add_defaults
File "build/bdist.linux-x86_64/egg/setuptools/command/sdist.py", line 130, in add_defaults
File "/usr/lib/python2.7/distutils/cmd.py", line 312, in get_finalized_command
cmd_obj.ensure_finalized()
File "/usr/lib/python2.7/distutils/cmd.py", line 109, in ensure_finalized
self.finalize_options()
File "/tmp/pycharm-packaging347/gdal/setup.py", line 214, in finalize_options
self.gdaldir = self.get_gdal_config('prefix')
File "/tmp/pycharm-packaging347/gdal/setup.py", line 188, in get_gdal_config
return fetch_config(option)
File "/tmp/pycharm-packaging347/gdal/setup.py", line 141, in fetch_config
raise gdal_config_error, e""")
File "<string>", line 4, in <module>
__main__.gdal_config_error: [Errno 2] No such file or directory
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pycharm-packaging347/gdal/
You are using pip version 7.1.0, however version 9.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Finally I found a solution to my problem.
sudo add-apt-repository ppa:ubuntugis/ppa
sudo apt-get update
sudo apt-get install gdal-bin
sudo apt-get -y install python-gdal
Thank you all for the contribution.

Fipy nominally installed but fipy.test() fails with error messages

I'm attempting to get FiPy set up using Miniconda 2 on a Windows 7 system, and got to the point of running the test suite with the recommended python -c "import fipy; fipy.test()".
Unfortunately rather than getting test results, the suite gave me an error with stack trace:
running egg_info
creating c:\users\bram\appdata\local\temp\tmpbzt0mv\FiPy.egg-info
writing c:\users\bram\appdata\local\temp\tmpbzt0mv\FiPy.egg-info\PKG-INFO
writing top-level names to c:\users\bram\appdata\local\temp\tmpbzt0mv\FiPy.egg-info\top_level.txt
writing dependency_links to c:\users\bram\appdata\local\temp\tmpbzt0mv\FiPy.egg-info\dependency_links.txt
writing manifest file 'c:\users\bram\appdata\local\temp\tmpbzt0mv\FiPy.egg-info\SOURCES.txt'
warning: manifest_maker: standard file '-c' not found
reading manifest file 'c:\users\bram\appdata\local\temp\tmpbzt0mv\FiPy.egg-info\SOURCES.txt'
writing manifest file 'c:\users\bram\appdata\local\temp\tmpbzt0mv\FiPy.egg-info\SOURCES.txt'
running test
running build_ext
fipy version 3.1.3
numpy version 1.12.0
pysparse is not installed
scipy version 0.18.1
matplotlib is not installed
gist is not installed
mpi4py is not installed
mpi4py is not installed
enthought.mayavi is not installed
gmsh is not installed
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "D:\Users\Bram\Miniconda2\lib\site-packages\fipy\__init__.py", line 164, in test
cmdclass={'test': _TestClass(_test)})
File "D:\Users\Bram\Miniconda2\lib\distutils\core.py", line 151, in setup
dist.run_commands()
File "D:\Users\Bram\Miniconda2\lib\distutils\dist.py", line 953, in run_commands
self.run_command(cmd)
File "D:\Users\Bram\Miniconda2\lib\distutils\dist.py", line 972, in run_command
cmd_obj.run()
File "D:\Users\Bram\Miniconda2\lib\site-packages\setuptools-27.2.0-py2.7.egg\setuptools\command\test.py", line 172, in run
File "D:\Users\Bram\Miniconda2\lib\site-packages\fipy\tests\testClass.py", line 236, in run_tests
testLoader = loader_class()
File "D:\Users\Bram\Miniconda2\lib\unittest\main.py", line 94, in __init__
self.parseArgs(argv)
File "D:\Users\Bram\Miniconda2\lib\unittest\main.py", line 149, in parseArgs
self.createTests()
File "D:\Users\Bram\Miniconda2\lib\unittest\main.py", line 158, in createTests
self.module)
File "D:\Users\Bram\Miniconda2\lib\unittest\loader.py", line 130, in loadTestsFromNames
suites = [self.loadTestsFromName(name, module) for name in names]
File "D:\Users\Bram\Miniconda2\lib\unittest\loader.py", line 100, in loadTestsFromName
parent, obj = obj, getattr(obj, part)
AttributeError: 'module' object has no attribute 'testFiPy'
Can anyone help me get this to work? I don't know where to start with this outcome.
Just wanted to add for those who (like me) are new to git and conda - to install the FiPy from develop branch you should (following this answer):
Activate your conda environment: source activate myenv (or activate
myenv for windows)
Install git and pip: conda install git pip
Install FiPy: pip install git+git://github.com/usnistgov/fipy#develop

ImportErrors with Python setuptools.command.sdist

I'm trying to install Newspaper, which installs a whole bunch of dependencies using pip. During the installation of a lot of its dependencies, this error is getting raised:
ImportError: <module 'setuptools.command.sdist' from '/usr/local/lib/python2.6/dist-packages/setuptools-10.0.1-py2.6.egg/setuptools/command/sdist.pyc'> has no '_default_revctrl' attribute
Installing without pip works fine, but is quite tedious due to the number of dependencies Newspaper has. Can anyone give me a hand?
Here's the full traceback for one instance of the error:
Complete output from command python setup.py egg_info:
running egg_info
creating pip-egg-info/Pillow.egg-info
writing pip-egg-info/Pillow.egg-info/PKG-INFO
writing top-level names to pip-egg-info/Pillow.egg-info/top_level.txt
writing dependency_links to pip-egg-info/Pillow.egg-info/dependency_links.txt
writing pip-egg-info/Pillow.egg-info/PKG-INFO
writing top-level names to pip-egg-info/Pillow.egg-info/top_level.txt
writing dependency_links to pip-egg-info/Pillow.egg-info/dependency_links.txt
writing manifest file 'pip-egg-info/Pillow.egg-info/SOURCES.txt'
warning: manifest_maker: standard file '-c' not found
Traceback (most recent call last):
File "<string>", line 20, in <module>
File "/tmp/pip-build-auItlo/Pillow/setup.py", line 757, in <module>
zip_safe=True,
File "/usr/lib/python2.6/distutils/core.py", line 152, in setup
dist.run_commands()
File "/usr/lib/python2.6/distutils/dist.py", line 975, in run_commands
self.run_command(cmd)
File "/usr/lib/python2.6/distutils/dist.py", line 995, in run_command
cmd_obj.run()
File "<string>", line 15, in replacement_run
File "/usr/local/lib/python2.6/dist-packages/setuptools-10.0.1-py2.6.egg/setuptools/command/egg_info.py", line 206, in find_sources
mm.run()
File "/usr/local/lib/python2.6/dist-packages/setuptools-10.0.1-py2.6.egg/setuptools/command/egg_info.py", line 290, in run
self.add_defaults()
File "/usr/local/lib/python2.6/dist-packages/setuptools-10.0.1-py2.6.egg/setuptools/command/egg_info.py", line 322, in add_defaults
rcfiles = list(walk_revctrl())
File "/usr/local/lib/python2.6/dist-packages/setuptools-10.0.1-py2.6.egg/setuptools/command/sdist.py", line 18, in walk_revctrl
for item in ep.load()(dirname):
File "/usr/local/lib/python2.6/dist-packages/setuptools-10.0.1-py2.6.egg/pkg_resources/__init__.py", line 2265, in load
raise ImportError("%r has no %r attribute" % (entry, attr))
ImportError: <module 'setuptools.command.sdist' from '/usr/local/lib/python2.6/dist-packages/setuptools-10.0.1-py2.6.egg/setuptools/command/sdist.pyc'> has no '_default_revctrl' attribute
This could also be caused by a change in setuptools released today:
https://bitbucket.org/pypa/setuptools/issue/320/cannot-upgrade-to-1001
running easy_install solved it for me:
easy_install --upgrade setuptools
Upgrading setuptools with pip can solve this:
sudo pip install --upgrade setuptools

Installing Fabric On Windows (Error No Module Called Readline)

I'm trying to use the Fabric 0.1.1 deploy tool (http://docs.fabfile.org/) on Windows and we're running into an issue with the readline module. I've been through various threads but can't seem to solve the issue. It's important because we can't deploy applications from Windows based machines.
C:\Documents and Settings\dev\Desktop\deploy>fab
Traceback (most recent call last):
File "C:\python\Scripts\fab-script.py", line 8, in <module>
load_entry_point('fabric==0.1.1', 'console_scripts', 'fab')()
File "c:\python\lib\site-packages\setuptools-0.6c9-py2.6.egg\pkg_resources.py"
, line 277, in load_entry_point
File "c:\python\lib\site-packages\setuptools-0.6c9-py2.6.egg\pkg_resources.py"
, line 2180, in load_entry_point
File "c:\python\lib\site-packages\setuptools-0.6c9-py2.6.egg\pkg_resources.py"
, line 1913, in load
File "build\bdist.win32\egg\fabric.py", line 25, in <module>
**ImportError: No module named readline**
Installing the module results in:
**easy_install readline**
Searching for readline
Reading http://pypi.python.org/simple/readline/
Reading http://www.python.org/
Best match: readline 2.6.4
Downloading http://pypi.python.org/packages/source/r/readline/readline-2.6.4.tar
.gz#md5=7568e8b78f383443ba57c9afec6f4285
Processing readline-2.6.4.tar.gz
Running readline-2.6.4\setup.py -q bdist_egg --dist-dir c:\docume~1\ji81b9~1.che
\locals~1\temp\easy_install-pzkz1a\readline-2.6.4\egg-dist-tmp-szs2ps
Traceback (most recent call last):
File "C:\python\Scripts\easy_install-script.py", line 8, in <module>
load_entry_point('setuptools==0.6c9', 'console_scripts', 'easy_install')()
File "c:\python\lib\site-packages\setuptools-0.6c9-py2.6.egg\setuptools\comman
d\easy_install.py", line 1671, in main
File "c:\python\lib\site-packages\setuptools-0.6c9-py2.6.egg\setuptools\comman
d\easy_install.py", line 1659, in with_ei_usage
File "c:\python\lib\site-packages\setuptools-0.6c9-py2.6.egg\setuptools\comman
d\easy_install.py", line 1675, in <lambda>
File "c:\python\lib\distutils\core.py", line 152, in setup
dist.run_commands()
File "c:\python\lib\distutils\dist.py", line 975, in run_commands
self.run_command(cmd)
File "c:\python\lib\distutils\dist.py", line 995, in run_command
cmd_obj.run()
File "c:\python\lib\site-packages\setuptools-0.6c9-py2.6.egg\setuptools\comman
d\easy_install.py", line 211, in run
File "c:\python\lib\site-packages\setuptools-0.6c9-py2.6.egg\setuptools\comman
d\easy_install.py", line 446, in easy_install
File "c:\python\lib\site-packages\setuptools-0.6c9-py2.6.egg\setuptools\comman
d\easy_install.py", line 476, in install_item
File "c:\python\lib\site-packages\setuptools-0.6c9-py2.6.egg\setuptools\comman
d\easy_install.py", line 655, in install_eggs
File "c:\python\lib\site-packages\setuptools-0.6c9-py2.6.egg\setuptools\comman
d\easy_install.py", line 930, in build_and_install
File "c:\python\lib\site-packages\setuptools-0.6c9-py2.6.egg\setuptools\comman
d\easy_install.py", line 919, in run_setup
File "c:\python\lib\site-packages\setuptools-0.6c9-py2.6.egg\setuptools\sandbo
x.py", line 27, in run_setup
File "c:\python\lib\site-packages\setuptools-0.6c9-py2.6.egg\setuptools\sandbo
x.py", line 63, in run
File "c:\python\lib\site-packages\setuptools-0.6c9-py2.6.egg\setuptools\sandbo
x.py", line 29, in <lambda>
File "setup.py", line 93, in <module>
AttributeError: 'module' object has no attribute 'symlink'
Has anybody solved this issue or can anybody suggest a workaround?
The readline module you are trying to install with easy_install is for OS X, not windows. There are Windows-compatible replacements for readline out there but perhaps you should first try updating fabric itself to a more current version (0.9 is out there now).
Grepping the source of the 0.9 version does not find any dependencies on readline.
Following these steps exactly worked for me:
1) Installed using the MSI installer for x86 from here.
2) Installed in the default C:\Python27 directory.
3) Create a new directory: C:\Python27\Scripts
4) Added C:\Python27 and C:\Python27\Scripts to the system path:
5) Download the distribute_setup.py from here into C:\Python27\Scripts
6) Open a command line, navigate to C:\Python27\Scripts, run: 'python distribute_setup.py'
7) now run 'easy_install pip'
8) now run 'pip install fabric'
9) You should get an error saying PyCrypto couldn't install. You can download the pre-build Windows binary from here. Run this to install PyCrypto.
10) run 'pip install fabric' again and it should say everything is installed.
11) in a different directory (let's say c:\dev\hello) create a fabfile.py and add the following code:
def hello(name="world"):
print("Hello %s!" % name)
12) cd to this directory and run 'fab hello:working'. You should see output say
Hello working!
Done.
Give this readline a try. It is a module for Windows that allows additional features in IPython that aren't native and might work with what you are trying to do.
0.1.1 is an older version, I believe. I have no problem installing Fabric on Windows with ActivePython (w/ PyPM):
C:\> pypm install fabric
Ready to perform these actions:
The following packages will be installed:
fabric-0.9.0 pycrypto-2.0.1
Get: [pypm.activestate.com] fabric 0.9.0-1
Get: [pypm.activestate.com] pycrypto 2.0.1-1
Installing fabric-0.9.0
Fixing script C:\Users\sridharr\AppData\Roaming\Python\Scripts\fab-script.py
Installing pycrypto-2.0.1
Download and run easy_install installer for your python version from http://pypi.python.org/pypi/setuptools#downloads . ie: setuptools-0.6c11.win32-py2.6.exe
On the command prompt, lauch easy_install -U fabric to install the last fabric release.
Readline should be available with Cygwin, if you want to move your entire stack in that direction.

Categories

Resources