hydrus/help/running_from_source.html

43 lines
4.8 KiB
HTML
Executable File

<html>
<head>
<title>running from source</title>
<link href="hydrus.ico" rel="shortcut icon" />
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="content">
<h3>running from source</h3>
<p>I write the client and server entirely in <a href="http://python.org">python</a>, which can run straight from source. I don't recommended this for someone who just wants to get the program working, but rather for those who have a general interest or wish to modify the program.</p>
<h3>what you will need</h3>
<p>You will need to install python 2.7 and several python modules. To see what your system needs, just keep running client.pyw and see what it complains about missing.</p>
<p>I recently got the client working on Ubuntu 14.04, which required:</p>
<p><ul>
<li>sudo apt-get install python2.7-dev</li>
<li>sudo pip install beautifulsoup4 pyyaml python-potr hsaudiotag PyPDF2 flvlib pafy lz4</li>
<li>sudo apt-get install python-numpy</li>
<li>sudo apt-get install python-opencv</li>
<li>sudo apt-get install python-wxversion</li>
<li>and installing a recent version of wxPython, which is difficult and best done <a href="http://wiki.wxpython.org/CheckInstall">like so</a></li>
<li>If you install wxPython as above and you get missing .so errors, try running 'sudo ldconfig'</li>
</ul></p>
<p>YMMV. Feel free to email me if you run into trouble or discover any neat tricks.</p>
<p>OS X 10.9 requires a similar pattern to above, though wx is simpler. I use the cocoa package <a href="http://wxpython.org/download.php#osx">straight from wxPython's site</a>. One user reports that this worked for 10.7:</p>
<p><ul>
<li>sudo pip install beautifulsoup4 pyyaml python-potr hsaudiotag PyPDF2 flvlib pafy numpy pil lxml lz4</li>
<li>brew tap homebrew/homebrew-science</li>
<li>brew install opencv</li>
<li>export PYTHONPATH=/usr/local/lib/python2.7/site-packages:$PYTHONPATH</li>
</ul></p>
<p>For Windows, you can do the same thing with easy_install and pip and module installers. Since it doesn't natively come with Python, you'll probably need to go through a bigger list. You'll find <a href="http://www.lfd.uci.edu/~gohlke/pythonlibs/">this</a> page very helpful. I have a fair bit of experience with Windows python, so send me a mail if you need help.</a>
<p>Some people have encountered problems with wxPython 3.0, so I use 2.9.x in my official releases. Again, YMMV.</p>
<p>You'll probably want to install Pillow (pip should do it for Linux/OS X, easy_install for Windows) instead of PIL, but go back to PIL if Pillow doesn't work.</p>
<p>If you want to import videos, you will need to put a static <a href="http://ffmpeg.org/">FFMPEG</a> executable in the install_dir/bin directory. Have a look at how I do it in the extractable compiled releases if you can't figure it out. You can either copy the exe from one of those releases, or download it right from the FFMPEG site. I don't include the FFMPEG exes in the source release like I do upnpc just because they are so big.</a>
<p>Once you have everything set up, client.pyw and server.pyw should look for and run off the database files just like the executables.</p>
<p>I develop hydrus on 64-bit Win 7, so the program is much more stable and reasonable on Windows. I am developing for Linux and OS X, but I do not have as much experience with them, so I would particularly appreciate your Linux/OS X bug reports and any informed suggestions.</p>
<h3>my code</h3>
<p>I find I work very much on a conceptual, boxes-and-arrows level. Although I <i>can</i> code in any language, I find the pedantic intricacies of C and its low-level friends a pain to work with, and not worth the performance gain. Python works with little hassle in a semantically rich way I appreciate; one line of intelligent and word-heavy python can do the work of 20 robotic <i>t+=ord(j_temp)%2;</i>s in C, and with far less fear of memory leaks or injection attacks or buffer overflows. I like long variable names and copious whitespace. I don't do much commenting because I am working alone and it usually makes quick sense to me, even when I haven't seen something for ages. If my code looks kooky to you, I'm sorry; my nerdism is INFJ, not INTP/J.</p>
<p>If you want to contribute to the project, please do! You can send the changes over <a href="https://github.com/hydrusnetwork/hydrus">github</a>, or just email them to me. I'm pretty OCD about my code style and grammar though, so be warned that I'll probably rewrite everything you submit!</p>
<p>I'm not enough of a participant in the open source community to release my code under a specific licence, so everything is just <a href="http://sam.zoy.org/wtfpl/COPYING">WTFPL</a>. In our internet age, I see copyright and copyleft as equally impotent.</p>
</div>
</body>
</html>