When running autodoc in Read-The-Docs, it fails with this error for my project:
Compiling sources ...error: [Errno 2] No such file or directory: 'gfortran'
I have learned that gfortran is not available in RTDF, so I wanted to try avoiding the command that causes the error when running Sphinx - something like
if not 'sphinx' in sys.modules
as suggested in this question.
However, when I want to build the documentation on RTFD, the error still occurs. I have even commented the whole line containing the command without success. Obviously, RTFD does not use the current code in repository branch that it should build from as it still throws an error from a command that is not in the code anymore. I also tried wiping the version, but it didn't help.
I really don't know what's going on. The RTFD build commands are
python3.5 -mvirtualenv --system-site-packages --no-download /home/docs/checkouts/readthedocs.org/user_builds/smuthi/envs/doc
python /home/docs/checkouts/readthedocs.org/user_builds/smuthi/envs/doc/bin/pip install --use-wheel --upgrade --cache-dir /home/docs/checkouts/readthedocs.org/user_builds/smuthi/.cache/pip -I Pygments==2.2.0 setuptools==37.0.0 docutils==0.13.1 mock==1.0.1 pillow==2.6.1 alabaster>=0.7,<0.8,!=0.7.5 commonmark==0.5.4 recommonmark==0.4.0 sphinx==1.6.5 sphinx-rtd-theme<0.3 readthedocs-sphinx-ext<0.6
install --exists-action=w --cache-dir /home/docs/checkouts/readthedocs.org/user_builds/smuthi/.cache/pip -rdocs/requirements.txt
I don't know what this means, but it contains --use-wheel and cache and stuff. An earlier version of my code did have a built distribution on PyPi, but the current doesn't.
Can this be the reason, i.e. does RTFD install from PyPi instead of from the GitLab repository, and does it use old wheels?
Has anybody experienced something similar?
Does anybody have an idea what is going wrong?
The problem was that I had the package itself in the docs/requirements.txt file, such that when building, the package was indeed installed from PyPi. After removing it from the requirements, the documentation was built correctly.
Related
I tried to install EmoPy NN to my computer (here is the link https://github.com/thoughtworksarts/EmoPy). I used both OS Ubuntu and Windows. The problem is in library versions. The error. I get an error while installing file requirements.txt.
So my next step was to install all of dependencies on my own, counting them one by one. But then another error occured, which said, that some methods are not valid.
As cloning from github was unsuccessful, I decided to try to use pip installer. Unfortunately, the same problem with the conflict of versions occured.
So are there any possible solutions or that NN is too old and too difficult to be installed?
P.S. I use python 3.6.6. as documentation requires
I have simple instruction with installed Anaconda (conda env python 3.6), cloned from Git an emopy.
pip install -r requirements.txt
there is a little feature with dependency version(one library needs old version scipy 1.0.0, other needs 1.0.1)
write pip install scikit-image==0.16.2
if you start script from examples\fernmodel_example.py(emotions are determined by photo here exactly, in others some weird figures, it's not our needs, if i'm not mistaken), it will get several errors in saving.py file from keras library - to delete .decode("utf-8") one by one, while doesn't work.
You can fix other exampeles, of course, but it doesn't make sense yet.
I'm trying to install pyinstaller on a windows 7 machine with no internet access at all. I've been following the manual as much as I can but I'm totally new to python, pip and whatnot. I downloaded the archive for PyPI and unzipped it to my local drive. After installing PyPiWin32 I CD'd to the pyinstaller folder and ran C:\python27\python setup.py install. It seemed like everything was installing fine but then I got an error that pyinstaller was looking for the "future" package online, and of course couldn't find it...
So then I looked through the manual some more and tried running pip pyinstaller install which now gives me this error
Could not find a version that satisfies the requirement future (from pyinstaller) (from versions: )
No matching distribution found for future (from pyinstaller)
So what I assume went wrong (and I'm really not familiar with this) is that I tried an install, it missed some vital package because that was online, and now it is a bit confused. So is there a way to manually install the "future" package or am I just doing this totally wrong?
Looking at their setup.py file they append a separate future package from PyPI, so you need to install that too before installing PyInstaller on Windows.
When in doubt, you can find a required package using this pattern:
https://pypi.python.org/pypi/<package>
and mostly (if not in all cases) it'll work just fine, therefore if you have a missing package future, just drop it into this url:
https://pypi.python.org/pypi/future
About the future package, it seems they require additional packages on Python 2.6, therefore you'll need importlib and argparse too judging from future's setup.py:
if sys.version_info[:2] == (2, 6):
REQUIRES += ['importlib', 'argparse']
TEST_REQUIRES += ['unittest2']
And just a note for installing, it's easier to navigate into a folder with a setup.py file and do:
pip install .
as it installs like it'd with pip install <package> therefore it'll be easier to uninstall a desired package.
In the end you'd do probably better to go for this question's solutions and download all required packages first with the same environment you want to target. Then you'll just point pip to the right folder, or install manually.
I've been working with Python for a little while now but have come to absolutely detest installing new modules. It always seems to take me a full work day to install one additional module. This last happened with mpl_toolkits and now it is happening with gdal.
The main issue seems to be that easy_install/pip/get-app aren't saving a file in the correct location and so Python (I'm using Spyder) can't find it. How do I install a module in a location so that Python can find it?
I have been reading guides, articles, manuals and Stack Overflow articles all day now and I feel this needs a new question as I can't find an answer.
It is installing fine, it's just Python (and I) can't find it
It's not in the /lib/python2.7/site-packages folder, which seems to be the Python default, although half the modules that do work aren't in there when I list it
I installed using:
sudo apt-get install gdal-bin
I also tried with:
pip install gdal
but this fails with the error:
Command "python setup.py egg_info" failed with the error code 1 in /tmp/pip-build-NWJT2f/gdal/
I looked for the files using
dpkg -L gdal
and then added the file path this said into Spyder's preferences option for PYTHONPATH, but it still couldn't find it and so I'm guessing this is wrong.
I have read the official documentation of PYTHONPATH, but it's very short and doesn't really explain it at all.
I recommend trying anaconda or miniconda, which manage environments and install packages - it 'just works'.
https://www.continuum.io/downloads
I feel like there must be a way to do this, but for the life of me I can't figure out how: I want to run pip against a requirements file in a virtualenv so that no matter what packages are in the virtualenv before I run pip, the requirements file is totally fulfilled (including specific versions) after I run it.
The problem now is that if I have an older version of a package installed in the virtualenv than is listed in the requirements file, it complains about the version mismatch and exits (it should just update the package to the given version). The command I'm running is pip install -I -r requirements.txt and according to pip's help, -I is supposed to make pip "Ignore the installed packages (reinstalling instead)" but it definitely isn't doing that.
What am I missing?
(It'd be nice if pip skipped the packages that are already fulfilled too.)
I figured out what the cause of my pip problems was. Long story short, source left over in the virtualenv's build directory was causing an error that made packages upgrades fail. What I actually should have been doing was clearing out that directory (which pip doesn't always do I guess) before running the pip install and it seems to do everything I want after when paired with the --upgrade/-U flag.
I'm working with PyInstaller under Python 2.6, which is only partially supported due to the mess MS have created with their manifest nonense which now affects Python since it is now MSVC8 compiled.
The problem is that the manifest embedding support relies on the pywin32 extensions in order to build which is a pain because without including the host's site-packages folder when I create the virtualenv (kinda defeats the point in a build environment) I cannot find a way to install the required extensions so they are accessible to PyInstaller.
Has anyone found a solution to this issue?
I found http://old.nabble.com/Windows:-virtualenv-and-pywin32--td27658201.html (now a dead link) which offered the following solution:
Browse http://sourceforge.net/projects/pywin32/files/ for the URL of the exe you want
Activate your virtualenv
Run easy_install http://PATH.TO/EXE/DOWNLOAD
This works with modern versions of setuptools (circa February 2014, reported by tovmeod in the comments).
If you are using an old version of setuptools (or distribute it merged back into setuptools), you may get this error message:
error: c:\users\blah\appdata\local\temp\easy_install-ibkzv7\pywin32-214.win32-py2.6.exe is not a valid distutils Windows .exe
In which case:
Download the exe yourself
Activate your virtualenv
Run easy_install DOWNLOADED_FILE.exe
I rather hopefully tried "pip install" rather than "easy_install", but this didn't work, and likely never will (citation needed).
Finally, I found but haven't tested a solution at http://www.mail-archive.com/python-list#python.org/msg272040.html which is:
Solved this by copying the pywin32.pth file into my virtualenv site-packages
and editing the file to point to the path.
If the other options don't work for you, maybe this will?
For Python 2.7 or 3.x use pypiwin32.
pip install pypiwin32
OK, well since I had to find a way forward I improvised. I've internally created a git repository with a hacked-together version of pywin32 that will install within a virtualenv using the standard setup.py script. It took a lot of fiddling to make it work right but I managed to get it to load and the dependent code now works as I need it to. If people feel this would be of benefit to the community please post a comment: if I get enough I'll try and put something up on my github account.
This may have been improved since previous answer, since I've successfully installed pywin32 on sandbox on several machines without any specific "hacks" :
$ virtualenv sandbox
$ sandbox\scripts\activate
(sandbox) $ git clone https://github.com/Travis-Sun/pywin32.git
(sandbox) $ cd pywin32
(sandbox) $ python setup.py install
Tested with following environment :
windows 7
git
python 2.7.10 with virtualenv
VS2008. It may also work (but I've not tested yet) with
http://www.microsoft.com/en-us/download/details.aspx?id=44266
Edit: Scratch this for now, appears to be some problems with the installation still...
I got rather tired of the whole situation, and just created a set of converted wheels ("wheel convert <.exe>"). I'll try and keep them maintained for the most recent build, but do shout if there are any issues.
https://tr00st.co.uk/python/wheel/pywin32/
Installation can be done easily using pip and pointing to the package matching your version and architecture. For example, for Python 3.5/amd64:
pip install https://tr00st.co.uk/python/wheel/pywin32/pywin32-219-cp35-none-win_amd64.whl
Caveat: The --upgrade process currently fails, as the uninstall procedure is unable to clean up after itself (Access Denied when cleaning up win32api.pyd) - this is only when removing the temporary directory, which can be manually deleted. Easiest way around this is to uninstall and reinstall instead of upgrading, then manually delete the temporary folder.