I am trying to run the command sudo python3 setup.py install in the research directory of TensorFlow models but I am getting the following error:
File "/tmp/easy_install-7odqdand/matplotlib-3.2.0rc3/setup.py", line 136
raise IOError(f"Failed to download jquery-ui. Please download "
^
SyntaxError: invalid syntax
What may be the problem?
You are likely using a version of python less than Python3.6.
f-strings are used and supported since then apparently.
https://github.com/matplotlib/matplotlib/issues/17075#issuecomment-611190672
If you don't want to upgrade python just upgrade matplotlib to version 2.1.0 which is the minimum requirement for tensorflow object detection API. I just did that and been able to install Tensorflow Object detection API on Ubuntu 16, which comes with python 3.5.
Related
I'm trying to run code from a repository from 2016 that doesn't label what versions of anything it's using, but I think I figured out that it was using Python version 3.4. I went ahead and installed that python version, but when I went to install the dependencies, starting with Numpy, I got this error when running
pip install numpy
The error is as follows
SyntaxError: invalid syntax
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "C:\Users\sam\AppData\Local\Temp\pip_build_sam\numpy\setup.py", line 64
raise RuntimeError(f'Cannot parse version {FULLVERSION}')
^
SyntaxError: invalid syntax
Not sure what to do. My machine is a windows-10-64bit Python version is 3.4.0 and pip version is 1.5.4. If anyone cares to see if there's a more holistic way to get this code to run, this is the repo. https://github.com/czhuang/ChordRipple
The setup script for the version of Numpy you're trying to install is using an f-string. However, f-strings were introduced in Python 3.6, so your version does not support this. Installing an older version of numpy should work. Version 1.15.4 should be the latest one that supports Python 3.4.
pip install numpy==1.15.4 should do the trick.
I'm trying to install SimpleElastix for python. As far as I can tell, you can either download a whl file from https://simpleelastix.github.io/#download
or simply pip install as shown here: https://pypi.org/project/SimpleITK-SimpleElastix/
I first tried downloading it and am trying to install SimpleITK-0.9.1rc1.dev163-cp34-cp34m-win_amd64.whl that I have saved to drive.
I am using the following (pip has been updated):
(hids3) C:\Windows\system32>python --version
Python 3.8.0
(hids3) C:\Windows\system32>pip --version
pip 22.0.4 from C:\Users\kated\anaconda3\envs\hids3\lib\site-packages\pip (python 3.8)
I try to run pip install SimpleITK-0.9.1rc1.dev163-cp34-cp34m-win_amd64.whl
and get the following error:
ERROR: SimpleITK-0.9.1rc1.dev163-cp34-cp34m-win_amd64.whl is not a supported wheel on this platform.
According to Error "filename.whl is not a supported wheel on this platform" , this could be caused by a downloading the .whl file for a wrong python version. I would expect python 3.8 to support a CPython 3.4 version or am I wrong for assuming this?
Alternative way to download SimpleElastix: https://pypi.org/project/SimpleITK-SimpleElastix/
I also tried running
pip install --user SimpleITK-SImpleElastix
in the terminal, which worked, but when I run
import SimpleITK as sitk
sitk.Elastix()
I get
AttributeError: module 'SimpleITK' has no attribute 'Elastix'
Anyone have any idea what I'm doing wrong in either case?
I am following this official guide for building a package for anaconda based on a skeleton. I just want to build the example package used in the tutorial, which is pyinstrument.
I am using anaconda2 version 4.5.11 under MacOS High Siera (10.13.6).
When running the command conda_build pyinstrument, I am getting the following error (full output here):
File
"/Users/me/anaconda2/envs/blbuild/lib/python2.7/site-packages/cffi/vengine_cpy.py",
line 159, in load_library
raise VerificationError(error) cffi.error.VerificationError: importing
'/Users/me/anaconda2/envs/blbuild/lib/python2.7/site-packages/cryptography/_Cryptography_cffi_4ed9e37dx4000d087.so':
dlopen(/Users/me/anaconda2/envs/blbuild/lib/python2.7/site-packages/cryptography/_Cryptography_cffi_4ed9e37dx4000d087.so,
2): Library not loaded: #loader_path/../../../libcrypto.1.0.0.dylib
Referenced from:
/Users/me/anaconda2/envs/blbuild/lib/python2.7/site-packages/cryptography/_Cryptography_cffi_4ed9e37dx4000d087.so Reason: image not found
I have already tried reinstalling openssl via brew, because I found this recommendation when searching SO for the error message, it had no effect on the error though. My openssl version from brew is 1.0.2p in case that matters.
What am I doing wrong?
I was able to finally resolve this issue. The solution was to manually install a package that seems to be required:
conda install cryptography
I try to learn TensorFlow with Python. My problem is with import TF module. Here is my configuration: Python 3.6.1, Windows 7 (with MSVCP140.dll)
I've installed TensorFlow by command (in power shell). It works.
python -m pip install --upgrade tensorflow
But when I run python environment and try import Tensor Flow
import tensorflow as tf
I get errors, this error raise another errors related with it, but at the beginning I want to resolve this first
Traceback (most recent call last): File
"C:\Users\Jacek\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\pywrap_tensorflow.py",
line 18, in swig_import_helper
fp, pathname, description = imp.find_module('_pywrap_tensorflow', [dirname(file)]) File
"C:\Users\Jacek\AppData\Local\Programs\Python\Python36\lib\imp.py",
line 296, in find_module
raise ImportError(_ERR_MSG.format(name), name=name) ImportError: No module named '_pywrap_tensorflow'
The problem was the cuDNN Library for me - for whatever reason cudnn-8.0-windows10-x64-v6.0 was NOT working - I used cudnn-8.0-windows10-x64-v5.1 - ALL GOOD!
My setup working with Win10 64 and the Nvidia GTX780M:
Be sure you have the lib MSVCP140.DLL by checking your system/path - if not get it here
Run the windows installer for python 3.5.3-amd64 from here - DO NOT try newer versions as they probably won't work
Get the cuDNN v5.1 for CUDA 8.0 from here - put it under your users folder or in another known location (you will need this in your path)
Get CUDA 8.0 x86_64 from here
Set PATH vars as expected to point at the cuDNN libs and python (the python path should be added during the python install)
If you run Windows 32 be sure to get the 32 bit versions of the files mentioned above.
Solution is downgrade Python to version 3.5, and install again TensorFlow. It works for me
This is a known error. There is a file named MSVCP140.DLL, that you will need in your system to run TensorFlow. Check if this file is in your %path%. If it is not, download Visual Studio C++. It is free and you can download it here: https://www.visualstudio.com/vs/cplusplus.
Solution:-
Don't suffer a lot. Simply downgrade your python version from 3.6.1 to 3.5.2 and
install tensorflow again.. you need not to upgrade the package.
"pip install tensorflow" will automatically download latest version (probably
1.0.1)
Steps:-
Step 1:- conda search python
Step 2:- conda install python=3.5.2
Step 3:- pip install tensorflow
Step 4:- import tensorflow as tf
Horray!!.. It works..
Hope you may not get the same error again!!
At first, I used an anaconda environment with Python 3.5 and PIP version 19 but had the same problem. so instead of PIP, I used Conda package manager:
conda install TensorFlow
it worked well after using Conda instead of PIP
If you have a GPU in your system and it is conflicting with the current set of libraries or throwing a cudnn error then you can add the following line in your code to disable the GPU
os.environ["CUDA_VISIBLE_DEVICES"] = "-1"
put this in your code and it should be fine.
pip install tensorflow-gpu
Install this package this helps me to solve my issues
or else use python 3.9.7
When i follow the website (https://www.kaggle.com/wiki/GettingStartedWithPythonForDataScience) and type python makeSubmission.py I get the following error message :
ImportError: No module named sklearn
I think I have already successfully installed the following:
Python 3.4 for windows
sciPy,NumPy and matplotlib
setuptools
scikit-learn
PyCharm
I then opened "Python 3.4 command line" and typed import sys; print(sys.__path__),but I got the message
Traceback (most recent call last): File "<stdin>", line 1, in <module>
AttributeError: module object has no attribute '__path__'
Anyone can help?
Looks like you haven't installed scikit-learn properly. pip install -U scikit-learn should do the job. Also, I would suggest downloading the Anaconda distribution of python if you're planning to use python for kaggle contests. It takes care of all the necessary dependencies and contains all the commonly needed python packages for the contest. I found that easier than the tedious download of the dependencies. Here's the Link
The Ubuntu 14.04 package is named python-sklearn (formerly python-scikits-learn) and can be installed using the following command:
sudo apt-get install python-sklearn
If you are using PyCharm or any other IDE, then you have to install 'sklearn' separately in PyCharm tool too. In My Case I am using PyCharm, select
File Menu-> Default Settings-> Project Interpreter -> Press + button and type 'sklearn'
Press install button. Installation will be done in 10 to 20 seconds.
2nd option is if you already installed 'sklearn' using terminal then you have to set path in your PyCharm IDE.