installing tensorflow with gpu in windows fails with exception - windows

I have search all over and I now Im on the verge of just giving up.
The cpu version of tensorflow installs just fine but I want to use the gpu. I have before used theano with gpu with CUDA8 and cuDNN 5.1 so they should be ok.
I have also tried to install the nightly build of tensorflow with the same result.
Any suggestions on what to check next. I'm this close to throw it all away, install virtualbox and ubuntu and run everything from there (don't want to though because of prestigious reasons :) ).
(C:\Users\Jens\Anaconda3) C:\Users\Jens\Documents>pip install tensorflow-gpu
Collecting tensorflow-gpu
Using cached tensorflow_gpu-1.0.0-cp35-cp35m-win_amd64.whl
Requirement already satisfied: protobuf>=3.1.0 in c:\users\jens\anaconda3\lib\site-packages (from tensorflow-gpu)
Requirement already satisfied: six>=1.10.0 in c:\users\jens\anaconda3\lib\site-packages (from tensorflow-gpu)
Requirement already satisfied: numpy>=1.11.0 in c:\users\jens\anaconda3\lib\site-packages (from tensorflow-gpu)
Requirement already satisfied: wheel>=0.26 in c:\users\jens\anaconda3\lib\site-packages (from tensorflow-gpu)
Exception:
Traceback (most recent call last):
File "C:\Users\Jens\Anaconda3\lib\site-packages\pip\basecommand.py", line 215, in main
status = self.run(options, args)
File "C:\Users\Jens\Anaconda3\lib\site-packages\pip\commands\install.py", line 335, in run
wb.build(autobuilding=True)
File "C:\Users\Jens\Anaconda3\lib\site-packages\pip\wheel.py", line 749, in build
self.requirement_set.prepare_files(self.finder)
File "C:\Users\Jens\Anaconda3\lib\site-packages\pip\req\req_set.py", line 380, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "C:\Users\Jens\Anaconda3\lib\site-packages\pip\req\req_set.py", line 666, in _prepare_file
check_dist_requires_python(dist)
File "C:\Users\Jens\Anaconda3\lib\site-packages\pip\utils\packaging.py", line 48, in check_dist_requires_python
feed_parser.feed(metadata)
File "C:\Users\Jens\Anaconda3\lib\email\feedparser.py", line 177, in feed
self._input.push(data)
File "C:\Users\Jens\Anaconda3\lib\email\feedparser.py", line 101, in push
parts = data.splitlines(True)
AttributeError: 'NoneType' object has no attribute 'splitlines'*

It seems a problem with Anaconda itself and not with TensorFlow, could you please try:
Uninstall TensorFlow
Install TensorFlow with conda install
Also see this issue on Github.
I'd suggest as well, but with a caveat because I didn't test this one, to download a nightly build and install it instead of the PYPI package.
edit: now that I saw #mrry already had pointed you the direction to take so that might work.

You where both on the right track. I did a clean install of Anaconda3 and created two new environments. One for theano and one for tensorflow.
With the clean install I could use
pip install tensorflow-gpu
Now both theano and tensorflow works with GPU.
Thanks

Related

Installing pysam for HTSeq - "PackagesNotFoundError: The following packages are not available from current channels:"

I am new to Python, Anaconda, and coding in general. I'm trying to install pysam. I need it to install HTSeq so that I can convert bam files to count files for a class project. Once they are count files, I plan to use edgeR for the rest of the data analysis. I was able to install NumPy without a problem. I've tried multiple codes for installing pysam, so I'm wondering if I'm missing some sort of dependency? Do I need to install samtools or something before I can install pysam?
In addition to tips for installing pysam, I am also open to advice for other methods for converting bam files to count files. Is it possible to download and use HTSeq for this purpose without pysam? Converting the file is the only thing I need to use HTSeq for to complete my class project. Is there another program other than HTSeq that I could use?
I appreciate any advice, and sorry if I'm leaving out any critical information. This is my first big coding project and the first time I've had to ask a stack question.
Thanks!
Here is what I have tried to install pysam:
conda config --add channels r
Warning: 'r' already in 'channels' list, moving to the top
conda config --add channels bioconda
Warning: 'bioconda' already in 'channels' list, moving to the top
conda install pysam
conda install -c bioconda pysam
conda install -c "bioconda/label/cf201901" pysam
For every conda install I get the same output:
Collecting package metadata (current_repodata.json): done Solving environment: failed with initial frozen solve. Retrying with flexible solve. Collecting package metadata (repodata.json): done Solving environment: failed with initial frozen solve. Retrying with flexible solve.
PackagesNotFoundError: The following packages are not available from current channels:
pysam
Current channels: a bunch of links here that stack won't let me post To search for alternate channels that may provide the conda package you're looking for, navigate to
https://anaconda.org
and use the search bar at the top of the page.
```
```
I also tried:
conda config --append channels conda-forge
Warning: 'conda-forge' already in 'channels' list, moving to the bottom
And when I tried the conda install I got the same output as before.
Even though it's not recommended, I also tried to install with pip using:
pip install pysam
Collecting pysam Using cached pysam-0.20.0.tar.gz (4.0 MB) Preparing metadata (setup.py) ... error error: subprocess-exited-with-error
python setup.py egg_info did not run successfully. exit code: 1 [24 lines of output] pysam: cython is available - using cythonize if necessary pysam: htslib mode is shared pysam: HTSLIB_CONFIGURE_OPTIONS=None is not recognized as an internal or external command, operable program or batch file. is not recognized as an internal or external command, operable program or batch file. Traceback (most recent call last): File "<string>", line 2, in <module> File "<pip-setuptools-caller>", line 34, in <module> File "C:\Users\Emily\AppData\Local\Temp\pip-install-q06_8qe9\pysam_31e61bb6d116452f888986de7135a214\setup.py", line 381, in <module> htslib_make_options = run_make_print_config() File "C:\Users\Emily\AppData\Local\Temp\pip-install-q06_8qe9\pysam_31e61bb6d116452f888986de7135a214\setup.py", line 79, in run_make_print_config stdout = subprocess.check_output(["make", "-s", "print-config"]) File "C:\ProgramData\Anaconda3\lib\subprocess.py", line 424, in check_output return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, File "C:\ProgramData\Anaconda3\lib\subprocess.py", line 505, in run with Popen(*popenargs, **kwargs) as process: File "C:\ProgramData\Anaconda3\lib\subprocess.py", line 951, in __init__ self._execute_child(args, executable, preexec_fn, close_fds, File "C:\ProgramData\Anaconda3\lib\subprocess.py", line 1420, in _execute_child hp, ht, pid, tid = _winapi.CreateProcess(executable, args, FileNotFoundError: [WinError 2] The system cannot find the file specified pysam: htslib configure options: None [end of output]
note: This error originates from a subprocess, and is likely not a problem with pip. error: metadata-generation-failed
Encountered error while generating package metadata. See above for output.
note: This is an issue with the package mentioned above, not pip. hint: See above for details.
I also restarted my laptop, uninstalled and reinstalled Python and Anaconda. I am using Windows, and working in VS through Anaconda as an administrator.

Scipy installation windows 10

I have some difficulties trying to install Scipy for Python 3.5 on a Windows 10 machine and I hope I can find some help here. So here is what I have done so far.
I have downloaded the numpy+mkl for python 3.5 and 64bit version as well as the scipy0.18.1 for the same versions, from Gohlke's website
I installed the numpy+mkl whl with:
python -m pip install numpy-1.11.2+mkl-cp35-cp35m-win_amd64.whl
all goes well.
then I install the scipy package the same way like:
python -m pip install scipy-0.18.1-cp35-cp35m-win_amd64.whl
This also completes.
However, when I try to run python afterwards I get the following error:
Fatal Python error: Py_Initialize: can't initialize sys standard streams
Traceback (most recent call last):
File "C:\Python35\Lib\site-packages\scipy\io\__init__.py" , line 97, in <module>
File "C:\Python35\Lib\site-packages\scipy\io\matlab\__init__.py", line 13 in <module>
File "C:\Python35\Lib\site-packages\scipy\io\matlab\mio.py", line 8 in <module>
ImportError: No module named 'numpy'
I also get a pop-up that Python has stopped working.
I have tried a different order in which I installed the packages, but all lead to the error mentioned when Scipy is installed.
I also installed did this on a windows 7 machine and there it works.
Does anybody have any idea what causes this issue?
I also had some issues. So I just installed Anaconda3 insted of python directly.

Why does IronPython tell me that pip is a package and not an executable?

I am a complete newbie at Python. I wanted to try to see if Pyomo (a Python package for mathematical modeling) could work under IronPython because all my code for generating the data needed for Pyomo is in C#.
I installed IronPython 2.7.5, then tried as an administrator the advice found in http://blog.ironpython.net/2014/12/pip-in-ironpython-275.html#disqus_thread on how to run "pip" for IronPython. I used the exact example they gave (installing html5lib):
ipy -X:Frames -m ensure pip
ipy -X:Frames -m pip install html5lib
The first line worked, and I see in the Lib/site-packages directory a folder called pip-6.1.1-py2.7.egg with lots of python code in it.
For the second line, I received the error:
Unhandled exception:
Traceback (most recent call last):
File "C:\Program Files (x86)\IronPython 2.7\Lib\runpy.py", line 170, in run_module
File "C:\Program Files (x86)\IronPython 2.7\Lib\runpy.py", line 111, in _get_module_details
ImportError: No module named urllib; 'pip' is a package and cannot be directly executed
At this point, I'm stuck. Any help would be appreciated.
Just in case this helps, printing out the sys.version gives:
2.7.5 (IronPython 2.7.5 (2.7.5.0) on .NET 4.0.30319.34209 (32-bit))
I encountered the same problem. It seems that IronPython can't deal with more recent versions of pip. What I did was:
remove all traces from pip and setuptools from IronPython's Lib\site-packages folder
run from a commandline: ipy.exe -X:Frames -m ensurepip
this installed an old version of pip, one that IronPython understands. Verify this by checking that a folder pip-1.5.6.dist-info appears in IronPython's Lib/site-packages
Moral of the story; don't upgrade to a newer pip version when using IronPython

TypeError when downloading rapidsms using pip in django-tables2

I'm a total python newbie. I installed python 3.3.1 on a 32 bit windows 7 professional. I'm trying to install RapidSMS, and it should be as easy as "pip install rapidsms" and it does start the process, but it doesn't complete and I'm left with the below error message.
I've been trying to google it, but I haven't been able to find this specific problem, for the error I find fixes for people who have written the code themselves, and I haven't seen anyone mention this problem about rapidsms themselves. Since it stops in Django-tables, I wonder if I messed up that installation somehow or if there's a problem with the python version compatibility. I've used pip when installing some other software, so I don't think that's the problem.
So if anyone's encountered this error when installing pyhton packages or really have any idea what the cause might be I'd really appreciate it! (I also plan to post this in the RapidSMS mailing list when I get approved, but wanted to see if this was a more general problem that might have a fix.)
Downloading/unpacking django-tables2==0.13.0 (from rapidsms)
Running setup.py egg_info for package django-tables2
Traceback (most recent call last):
File "<string>", line 16, in <module>
File "c:\users\mhealth1\appdata\local\temp\pip-build-mhealth1\django-tables2\setup.py", line 7, in <module>
version = re.search('__version__ = "(.+?)"', f.read()).group(1)
File "C:\Python33\lib\re.py", line 161, in search
return _compile(pattern, flags).search(string)
TypeError: can't use a string pattern on a bytes-like object
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 16, in <module>
File "c:\users\mhealth1\appdata\local\temp\pip-build-mhealth1\django-tables2\setup.py", line 7, in <module>
version = re.search('__version__ = "(.+?)"', f.read()).group(1)
File "C:\Python33\lib\re.py", line 161, in search
return _compile(pattern, flags).search(string)
TypeError: can't use a string pattern on a bytes-like object
----------------------------------------
Command python setup.py egg_info failed with error code 1 in c:\users\mhealth1\a
ppdata\local\temp\pip-build-mhealth1\django-tables2
Storing complete log in C:\Users\mhealth1\pip\pip.log
Django-tables2 fails to install in Python3 because of the following code from line 7 of setup.py in the traceback:
version = re.search('__version__ = "(.+?)"', f.read()).group(1)
This should work if the search pattern was a bytes object. A byte literal can be created by simply pre-pending the string literal with a b like the following:
version = re.search(b'__version__ = "(.+?)"', f.read()).group(1)
This is why Python is throwing a TypeError with the message "Can't use a string pattern on a bytes-like object". The file contents are being read in as bytes.
I don't think RapidSMS currently supports Python3 yet based on its list of environments that are tested. This can be seen in the tox environments list of the project seen here, in which only Python 2.6 and 2.7 are listed: https://github.com/rapidsms/rapidsms/blob/develop/tox.ini#L2
To solve the immediate problem, you'll want to install RapidSMS in a virtual environment with Python 2.6 or 2.7. The documentation for RapidSMS describes virtual environment setup briefly here: http://www.rapidsms.org/en/develop/topics/virtualenv.html
You'll want to install Python 2.6 or 2.7 on your system and specify which Python for the virtualenv to use, using the -p or --python argument. The following is taken from the RapidSMS docs linked above, but ammended to specify using Python 2.7:
mkvirtualenv --distribute --no-site-packages rapidsms --python=python2.7

MySQL-Python with PyPy

MySQL-Python (MySQLdb) is known to work with PyPy. How do you make it work?
I tried downloading it and installing:
C:\dev\Installs\MySQL-python\MySQL-python-1.2.3>pypy setup.py install
Traceback (most recent call last):
File "app_main.py", line 51, in run_toplevel
File "setup.py", line 15, in <module>
metadata, options = get_config()
File "C:\dev\Installs\MySQL-python\MySQL-python-1.2.3\setup_windows.py", line 7, in get_config
serverKey = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, options['registry_key'])
WindowsError: [Error 2] The system cannot find the file specified.
Then I tried to download the ctypes implementation which seemed to have installed ok, however trying to use it gave:
...
File "C:\pypy-1.7\site-packages\django\db\backends\mysql\base.py", line 14, in <module>
raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e)
ImproperlyConfigured: Error loading MySQLdb module: Can't find a libmysqlclient
I'm at a loss at this point. How do I make it work
Regarding your second error with mysql-ctypes, the answer is that the line
ctypes.util.find_library('mysqlclient')
can't find the library on windows. Changing it to:
ctypes.util.find_library('mysqlclient.lib')
works on my system - but that only gets you to the next error (windows error 193) on my system.
you're right, the original MySQLdb is known to not work on PyPy.
I never tried to install mysql-ctypes on a windows maschine as I do not have one, but do you have libmysqlclient installed in your PATH?
If so, you may try my (sadly not yet merged) fork on https://github.com/EnTeQuAk/mysql-ctypes which has support for a bit more versions of libmysqlclient.
I had no issues with the MySQLdb package in pypy after installing it using pip.
You can find instructions for installing pip for pypy in the second section of the following link: http://doc.pypy.org/en/latest/getting-started.html#installing-pypy
Once you have pip installed, it's just a matter of running
pip install MySQL-python

Resources