<p>You should install dependencies first</p>

<pre><code>yum install python-devel* python-twisted gcc
</code></pre>

<p>Good luck ..</p>

CC BY-SA 3.0
2013-10-13T18:09:46.430Z
2013-10-13T18:09:46.430Z
Cristian Florescu
<p>I was trying to build stratum mining proxy on a Centos x64 machine. As mentioned below the script is throwing compilation errors, any idea?</p>

<pre><code>[root@host.com slush0-stratum-mining-proxy-7b5c080]# python ./setup.py install
/root/Desktop/mining/slush0-stratum-mining-proxy-7b5c080/distribute_setup.py:139: UserWarning: Module distribute_setup was already imported from /root/Desktop/mining/slush0-stratum-mining-proxy-7b5c080/distribute_setup.pyc, but /usr/lib/python2.6/site-packages/stratum-0.2.12-py2.6.egg is being added to sys.path
  import pkg_resources
running install
running bdist_egg
running egg_info
writing requirements to stratum_mining_proxy.egg-info/requires.txt
writing stratum_mining_proxy.egg-info/PKG-INFO
writing top-level names to stratum_mining_proxy.egg-info/top_level.txt
writing dependency_links to stratum_mining_proxy.egg-info/dependency_links.txt
reading manifest file 'stratum_mining_proxy.egg-info/SOURCES.txt'
writing manifest file 'stratum_mining_proxy.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
creating build/bdist.linux-x86_64/egg
creating build/bdist.linux-x86_64/egg/mining_libs
copying build/lib/mining_libs/client_service.py -&gt; build/bdist.linux-x86_64/egg/mining_libs
copying build/lib/mining_libs/worker_registry.py -&gt; build/bdist.linux-x86_64/egg/mining_libs
copying build/lib/mining_libs/stratum_listener.py -&gt; build/bdist.linux-x86_64/egg/mining_libs
copying build/lib/mining_libs/version.py -&gt; build/bdist.linux-x86_64/egg/mining_libs
copying build/lib/mining_libs/__init__.py -&gt; build/bdist.linux-x86_64/egg/mining_libs
copying build/lib/mining_libs/midstate.py -&gt; build/bdist.linux-x86_64/egg/mining_libs
copying build/lib/mining_libs/getwork_listener.py -&gt; build/bdist.linux-x86_64/egg/mining_libs
copying build/lib/mining_libs/jobs.py -&gt; build/bdist.linux-x86_64/egg/mining_libs
copying build/lib/mining_libs/multicast_responder.py -&gt; build/bdist.linux-x86_64/egg/mining_libs
copying build/lib/mining_libs/utils.py -&gt; build/bdist.linux-x86_64/egg/mining_libs
byte-compiling build/bdist.linux-x86_64/egg/mining_libs/client_service.py to client_service.pyc
byte-compiling build/bdist.linux-x86_64/egg/mining_libs/worker_registry.py to worker_registry.pyc
byte-compiling build/bdist.linux-x86_64/egg/mining_libs/stratum_listener.py to stratum_listener.pyc
byte-compiling build/bdist.linux-x86_64/egg/mining_libs/version.py to version.pyc
byte-compiling build/bdist.linux-x86_64/egg/mining_libs/__init__.py to __init__.pyc
byte-compiling build/bdist.linux-x86_64/egg/mining_libs/midstate.py to midstate.pyc
byte-compiling build/bdist.linux-x86_64/egg/mining_libs/getwork_listener.py to getwork_listener.pyc
byte-compiling build/bdist.linux-x86_64/egg/mining_libs/jobs.py to jobs.pyc
byte-compiling build/bdist.linux-x86_64/egg/mining_libs/multicast_responder.py to multicast_responder.pyc
byte-compiling build/bdist.linux-x86_64/egg/mining_libs/utils.py to utils.pyc
creating build/bdist.linux-x86_64/egg/EGG-INFO
installing scripts to build/bdist.linux-x86_64/egg/EGG-INFO/scripts
running install_scripts
running build_scripts
creating build/bdist.linux-x86_64/egg/EGG-INFO/scripts
copying build/scripts-2.6/mining_proxy.py -&gt; build/bdist.linux-x86_64/egg/EGG-INFO/scripts
changing mode of build/bdist.linux-x86_64/egg/EGG-INFO/scripts/mining_proxy.py to 755
copying stratum_mining_proxy.egg-info/PKG-INFO -&gt; build/bdist.linux-x86_64/egg/EGG-INFO
copying stratum_mining_proxy.egg-info/SOURCES.txt -&gt; build/bdist.linux-x86_64/egg/EGG-INFO
copying stratum_mining_proxy.egg-info/dependency_links.txt -&gt; build/bdist.linux-x86_64/egg/EGG-INFO
copying stratum_mining_proxy.egg-info/requires.txt -&gt; build/bdist.linux-x86_64/egg/EGG-INFO
copying stratum_mining_proxy.egg-info/top_level.txt -&gt; build/bdist.linux-x86_64/egg/EGG-INFO
zip_safe flag not set; analyzing archive contents...
creating 'dist/stratum_mining_proxy-1.5.2-py2.6.egg' and adding 'build/bdist.linux-x86_64/egg' to it
removing 'build/bdist.linux-x86_64/egg' (and everything under it)
Processing stratum_mining_proxy-1.5.2-py2.6.egg
removing '/usr/lib/python2.6/site-packages/stratum_mining_proxy-1.5.2-py2.6.egg' (and everything under it)
creating /usr/lib/python2.6/site-packages/stratum_mining_proxy-1.5.2-py2.6.egg
Extracting stratum_mining_proxy-1.5.2-py2.6.egg to /usr/lib/python2.6/site-packages
stratum-mining-proxy 1.5.2 is already the active version in easy-install.pth
Installing mining_proxy.py script to /usr/bin

Installed /usr/lib/python2.6/site-packages/stratum_mining_proxy-1.5.2-py2.6.egg
Processing dependencies for stratum-mining-proxy==1.5.2
Searching for twisted&gt;=12.2.0
Reading http://pypi.python.org/simple/twisted/
Best match: Twisted 13.1.0
Downloading http://pypi.python.org/packages/source/T/Twisted/Twisted-13.1.0.tar.bz2#md5=5609c91ed465f5a7da48d30a0e7b6960
Processing Twisted-13.1.0.tar.bz2
Writing /tmp/easy_install-2jd1TB/Twisted-13.1.0/setup.cfg
Running Twisted-13.1.0/setup.py -q bdist_egg --dist-dir /tmp/easy_install-2jd1TB/Twisted-13.1.0/egg-dist-tmp-tl_fLs
twisted/runner/portmap.c:10:20: error: Python.h: No such file or directory
twisted/runner/portmap.c:14: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
twisted/runner/portmap.c:31: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
twisted/runner/portmap.c:45: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘PortmapMethods’
twisted/runner/portmap.c: In function ‘initportmap’:
twisted/runner/portmap.c:55: warning: implicit declaration of function ‘Py_InitModule’
twisted/runner/portmap.c:55: error: ‘PortmapMethods’ undeclared (first use in this function)
twisted/runner/portmap.c:55: error: (Each undeclared identifier is reported only once
twisted/runner/portmap.c:55: error: for each function it appears in.)
error: Setup script exited with error: command 'gcc' failed with exit status 1
</code></pre>

CC BY-SA 3.0
2013-07-02T05:18:01.157Z
Found the solution, `twisted/runner/portmap.c:10:20: error: Python.h: No such file or directory` was more than enough to see what was the error. Missing Python developer package!!! 

Did `yum install python-devel -y` and Voila!
Jimson James
<bitcoind><client><stratum><compiling><proxy>
Stratum Mining proxy failed to compile on Centos 2.6.32-279.el6.x86_64
Jimson James
# Stratum Mining proxy failed to compile on Centos 2.6.32-279.el6.x86_64

(Asked by: username_0 on 2013-07-02)

I was trying to build stratum mining proxy on a Centos x64 machine. As mentioned below the script is throwing compilation errors, any idea?

```
[root@host.com slush0-stratum-mining-proxy-7b5c080]# python ./setup.py install
/root/Desktop/mining/slush0-stratum-mining-proxy-7b5c080/distribute_setup.py:139: UserWarning: Module distribute_setup was already imported from /root/Desktop/mining/slush0-stratum-mining-proxy-7b5c080/distribute_setup.pyc, but /usr/lib/python2.6/site-packages/stratum-0.2.12-py2.6.egg is being added to sys.path
  import pkg_resources
running install
running bdist_egg
running egg_info
writing requirements to stratum_mining_proxy.egg-info/requires.txt
writing stratum_mining_proxy.egg-info/PKG-INFO
writing top-level names to stratum_mining_proxy.egg-info/top_level.txt
writing dependency_links to stratum_mining_proxy.egg-info/dependency_links.txt
reading manifest file 'stratum_mining_proxy.egg-info/SOURCES.txt'
writing manifest file 'stratum_mining_proxy.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
creating build/bdist.linux-x86_64/egg
creating build/bdist.linux-x86_64/egg/mining_libs
copying build/lib/mining_libs/client_service.py -> build/bdist.linux-x86_64/egg/mining_libs
copying build/lib/mining_libs/worker_registry.py -> build/bdist.linux-x86_64/egg/mining_libs
copying build/lib/mining_libs/stratum_listener.py -> build/bdist.linux-x86_64/egg/mining_libs
copying build/lib/mining_libs/version.py -> build/bdist.linux-x86_64/egg/mining_libs
copying build/lib/mining_libs/__init__.py -> build/bdist.linux-x86_64/egg/mining_libs
copying build/lib/mining_libs/midstate.py -> build/bdist.linux-x86_64/egg/mining_libs
copying build/lib/mining_libs/getwork_listener.py -> build/bdist.linux-x86_64/egg/mining_libs
copying build/lib/mining_libs/jobs.py -> build/bdist.linux-x86_64/egg/mining_libs
copying build/lib/mining_libs/multicast_responder.py -> build/bdist.linux-x86_64/egg/mining_libs
copying build/lib/mining_libs/utils.py -> build/bdist.linux-x86_64/egg/mining_libs
byte-compiling build/bdist.linux-x86_64/egg/mining_libs/client_service.py to client_service.pyc
byte-compiling build/bdist.linux-x86_64/egg/mining_libs/worker_registry.py to worker_registry.pyc
byte-compiling build/bdist.linux-x86_64/egg/mining_libs/stratum_listener.py to stratum_listener.pyc
byte-compiling build/bdist.linux-x86_64/egg/mining_libs/version.py to version.pyc
byte-compiling build/bdist.linux-x86_64/egg/mining_libs/__init__.py to __init__.pyc
byte-compiling build/bdist.linux-x86_64/egg/mining_libs/midstate.py to midstate.pyc
byte-compiling build/bdist.linux-x86_64/egg/mining_libs/getwork_listener.py to getwork_listener.pyc
byte-compiling build/bdist.linux-x86_64/egg/mining_libs/jobs.py to jobs.pyc
byte-compiling build/bdist.linux-x86_64/egg/mining_libs/multicast_responder.py to multicast_responder.pyc
byte-compiling build/bdist.linux-x86_64/egg/mining_libs/utils.py to utils.pyc
creating build/bdist.linux-x86_64/egg/EGG-INFO
installing scripts to build/bdist.linux-x86_64/egg/EGG-INFO/scripts
running install_scripts
running build_scripts
creating build/bdist.linux-x86_64/egg/EGG-INFO/scripts
copying build/scripts-2.6/mining_proxy.py -> build/bdist.linux-x86_64/egg/EGG-INFO/scripts
changing mode of build/bdist.linux-x86_64/egg/EGG-INFO/scripts/mining_proxy.py to 755
copying stratum_mining_proxy.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO
copying stratum_mining_proxy.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying stratum_mining_proxy.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying stratum_mining_proxy.egg-info/requires.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying stratum_mining_proxy.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
zip_safe flag not set; analyzing archive contents...
creating 'dist/stratum_mining_proxy-1.5.2-py2.6.egg' and adding 'build/bdist.linux-x86_64/egg' to it
removing 'build/bdist.linux-x86_64/egg' (and everything under it)
Processing stratum_mining_proxy-1.5.2-py2.6.egg
removing '/usr/lib/python2.6/site-packages/stratum_mining_proxy-1.5.2-py2.6.egg' (and everything under it)
creating /usr/lib/python2.6/site-packages/stratum_mining_proxy-1.5.2-py2.6.egg
Extracting stratum_mining_proxy-1.5.2-py2.6.egg to /usr/lib/python2.6/site-packages
stratum-mining-proxy 1.5.2 is already the active version in easy-install.pth
Installing mining_proxy.py script to /usr/bin

Installed /usr/lib/python2.6/site-packages/stratum_mining_proxy-1.5.2-py2.6.egg
Processing dependencies for stratum-mining-proxy==1.5.2
Searching for twisted>=12.2.0
Reading http://pypi.python.org/simple/twisted/
Best match: Twisted 13.1.0
Downloading http://pypi.python.org/packages/source/T/Twisted/Twisted-13.1.0.tar.bz2#md5=5609c91ed465f5a7da48d30a0e7b6960
Processing Twisted-13.1.0.tar.bz2
Writing /tmp/easy_install-2jd1TB/Twisted-13.1.0/setup.cfg
Running Twisted-13.1.0/setup.py -q bdist_egg --dist-dir /tmp/easy_install-2jd1TB/Twisted-13.1.0/egg-dist-tmp-tl_fLs
twisted/runner/portmap.c:10:20: error: Python.h: No such file or directory
twisted/runner/portmap.c:14: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
twisted/runner/portmap.c:31: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
twisted/runner/portmap.c:45: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘PortmapMethods’
twisted/runner/portmap.c: In function ‘initportmap’:
twisted/runner/portmap.c:55: warning: implicit declaration of function ‘Py_InitModule’
twisted/runner/portmap.c:55: error: ‘PortmapMethods’ undeclared (first use in this function)
twisted/runner/portmap.c:55: error: (Each undeclared identifier is reported only once
twisted/runner/portmap.c:55: error: for each function it appears in.)
error: Setup script exited with error: command 'gcc' failed with exit status 1

```

**Tags:** bitcoind, client, stratum, compiling, proxy

> **Comments:**
> **username_0**: Found the solution, `twisted/runner/portmap.c:10:20: error: Python.h: No such file or directory` was more than enough to see what was the error. Missing Python developer package!!!   Did `yum install python-devel -y` and Voila!  

---

## 1 answers

### Answer by username_1 on 2013-10-13. Score: 1

You should install dependencies first

```
yum install python-devel* python-twisted gcc

```

Good luck ..


---

