pip install cx_Oracle -> failed with exit status 1120 - windows

I'm trying to install cx_Oracle, but i've faced with the problem while installing.
I've got an error:
LINK : error LNK2001: unresolved external symbol _DllMainCRTStartup
build\lib.win-amd64-3.4_mysql.pyd : fatal error LNK1120: 56
unresolved extern als error: command 'c:\Program Files
(x86)\Microsoft Visual Studio 10.0\VC\Bin \amd64\link.exe' failed
with exit status 1120
System Info:
Windows 7 x64
Python 3.4.3 x64.
I use the following guide for setup C++ part of installation:
http://blog.ionelmc.ro/2014/12/21/compiling-python-extensions-on-windows/#id7
I've googled a lot of issues, but i didn't manage to find solution for my own one. Also I've got the same error while installing MySQL-python.

you must install oracle client first
make sure :win7 x64; python x64; oracle client x64
pip install cx_Oracle

Ran into the same issue with the source install, but the binaries got it working for me. Install the binary from http://www.lfd.uci.edu/~gohlke/pythonlibs/#cx_oracle. If you need here is the guide for the pip wheel install: https://pip.pypa.io/en/latest/user_guide/#installing-from-wheels

Try to use this commands in command line.
git clone https://github.com/oracle/python-cx_Oracle.git cx_Oracle
cd cx_Oracle
git submodule init
git submodule update
pip install cx_Oracle
here is a link also: [link to try]

Related

How can I solve this installation problem with fastavro on Mac?

I am trying to run in my Mac a Python program which requires working with .avro binary files.
Despite trying to install it by using: pip install fastavro, I always get an error message on the terminal that ends with the following lines:
...
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
error: command '/usr/bin/clang' failed with exit code 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for fastavro
Failed to build fastavro
ERROR: Could not build wheels for fastavro, which is required to install pyproject.toml-based projects
I have updated conda to its latest version on my PC as well as updated pip as well.
Does anyone know how to solve this? I really need to run this program on Mac as soon as possible. For your information, I am able to install and use fastavro on Windows but not on Mac so this is likely to be a Mac-specific problem.
Thanks a lot
Since you are working in a conda environment, why not install it with conda? I often find installations via conda much more convenient since it takes care of all non-Python dependencies as well.
So try uninstalling the package first with pip: pip uninstall fastavro and then installing it via conda: conda install fastavro -c conda-forge.
In case you are unfamiliar with the -c conda-forge flag, it tells conda to look for the package on the conda-forge channel which has almost all packages that are not available via the standard channels.

`pip install ./` cannot call cmake command

I'm working on setting up a project (from someone else), which is currently not able to be installed. Within the root folder I'm trying to run pip install ./, but the installation gives me the following error.
File "C:\Users\ruben\miniconda3\envs\deltaconv\lib\subprocess.py", line 528, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['cmake', '--version']' returned non-zero exit status 1.
----------------------------------------
ERROR: Failed building wheel for deltaconv
Failed to build deltaconv
ERROR: Could not build wheels for deltaconv which use PEP 517 and cannot be installed directly
It seems like the setup.py file is unable to locate cmake. However, when running this in the miniconda promt, I get:
>cmake --version
cmake version 3.24.1
CMake suite maintained and supported by Kitware (kitware.com/cmake).
And when running it in a windows command prompt I get:
>cmake --version
cmake version 3.24.2
CMake suite maintained and supported by Kitware (kitware.com/cmake).
I've installed it both on the windows machine and in python and I'm a bit stuck on why the python subprocess is unable to execute cmake --version.
Hopefully someone can help me with this!

Message "note: This error originates from a subprocess, and is likely not a problem with pip"

While downloading pip install allennlp==1.0.0 allennlp-models==1.0.0, I faced this problem:
[6 lines of output]
running bdist_wheel
running build
running build_py
running build_ext
building 'srsly.msgpack._unpacker' extension
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for srsly
Failed to build thinc blis srsly
ERROR: Could not build wheels for srsly, which is required to install pyproject.toml-based projects
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
I have downloaded:
pip install -vvv torch
pip install numpy
pip3 install --pre torch -f https://download.pytorch.org/whl/nightly/cpu/torch_nightly.html
and it still not working.
I am using Python 3.10.2 on Windows 11 Pro.
What should I do?
I had Python 3.10 and had the same error installing psutil from pip. I fixed the problem by installing an older version of pip using the command:
pip install pip==21.3.1
You have to install the Python 3.9.10 version from python.org and after installation, upgrade your pip and everything will be sorted.
It is the problem in Python 3.10.2... This method is working. I was suffering from the same problem in installing the turtle, so I did that and error was solved.
This particular error is caused by not having a C/C++ compiler installed. As said in the error message, either install MSVC or another compiler to compile it.
Please read your error messages; they are there for a reason.
If you're using a Python 3 image, this might help:
RUN apk update
RUN apk add make automake gcc g++ subversion python3-dev
Reference from Problems with pip install numpy - RuntimeError: Broken toolchain: cannot link a simple C program
https://visualstudio.microsoft.com/visual-cpp-build-tools/
Download and install or update
Microsoft Visual C++ 14.0 or greater is required.
You must be install build visual tools 15, 17, 19, or greater.
Download from Microsoft C++ Build Tools.
To solve this problem, you need to download Visual Studio from its main page.
If Visual Studio is already installed, then when you run the installer, you can modify it (by clicking the modify button):
During Visual Studio installation (or installation modification) choose Desktop Development with C++:
First: You installed the Mingw-w64 compiler with a full MSYS2 package, and this package included Python.
Second: you get the error because the plugin is not in the Python packages installed by MSYS2.
So: uninstall MSYS2 and install a minimalistic MinGW (MinGW - minimalistic GNU for Windows).
And finally Install a version of Python from the official Python page.
Now if you can install plugins.
I've found a similar question from GitHub, and credits goes to thaibee. Here I quote:
It's a problem with Microsoft products and is
very easy to solve.
If you can't install these plugins as well,
need to download it from other repositories like this one:
https://www.lfd.uci.edu/~gohlke/pythonlibs/ depends on the version of python and the system.
For example: for my Windows 11 (x64) and Python 3.10 I took this file: pyodbc‑4.0.32‑cp310‑cp310‑win_amd64.whl
It's very easy to install: pip install pyodbc‑4.0.32‑cp310‑cp310‑win_amd64.whl
After it, the system works well and didn't ask you about VC.
This solution I found in problem with the MySQL plugin for Django. I don't understand why - but they also use VC for the installation process.
I understand your problem, and I have faced it too. I tried multiple solutions, but it didn't work, so I simply uninstalled my Python and installed some older version of it. Example: I recently uninstalled Python 3.10.2 and installed 3.9.10.
It worked without any errors.
I had a similar problem while installing with pip3: building wheel for box2d-py (setup.py) ... error
The solution was just to install SWIG prior to box2d, so I added the following steps manually:
pip install swig
pip install gym[box2d]
For Mac, there is a possible workaround for this problem if you use Conda. The idea is to create an x86 environment on the Mac and do your pip install after that.
conda create -n <name>
conda activate <name>
conda config --env --set subdir osx-64
conda install python=3.8
Here I choose Python 3.8, but you can choose another version.
If you are on macOS (maybe Apple silicon) then first try to do this from your base location of the terminal:
eval "$(/opt/homebrew/bin/brew shellenv)"
Then, do brew update and brew upgrade.
Once you are done with that, type
brew install geos
Now again go to your virtual environment and activate it (if you are working in the virtualenv) and then type:
python3.10 -m pip3 install [module name]
I was facing the same problem when executing:
python -m pip install package-name
After many failed tentatives, what fixed the problem for me was executing:
py -m pip install package-name
When I type py in the terminal, it shows this information:
Python 3.9.8 (tags/v3.9.8:bb3fdcf, Nov 5 2021, 20:48:33) [MSC v.1929 64 bit (AMD64)] on win32
When I type python in the terminal, it shows this information:
Python 3.8.2 (default, Apr 9 2020, 13:17:39) [GCC 9.3.0 64 bit (AMD64)] on win32
I believe that this problem is related to the Python interpreter version.
I tried all recommendations that were written, but none worked. My Python was 3.11.
So I just installed Python 3.8.10 from here:
https://www.python.org/downloads/release/python-3810/
And ran
C:\Python38\python.exe -m pip install matplotlib
And it worked.
I faced a similar problem while installing pandas-datareader.
I was using Python 3.11.0, and after trying all possible solutions, I downloaded Python 9.10.0 and it worked fine.
We can install DVC with the below commands:
conda install -c conda-forge mamba # installs much faster than conda
mamba install -c conda-forge dvc
For more information please refer this: https://dvc.org/doc/install/

Module installation FAIL: pip install TA-Lib (ERROR: Command errored out with exit status 1)

I am trying to install TA-Lib with the following command in the terminal.
pip install TA-Lib
Unfortunatley, I got the following error message:
Building wheel for TA-Lib (setup.py) ... error
ERROR: Command errored out with exit status 1......
Many thanks in advance for your help !
Follow TA-Lib author "mrjbq7"'s full instructions here: https://github.com/mrjbq7/ta-lib
You'll first download the built file from author, download and install VS community for the x64 command prompt tool, rebuild library, then finally install TA-Lib.
Download ta-lib-0.4.0-msvc.zip from http://prdownloads.sourceforge.net/ta-lib/ta-lib-0.4.0-msvc.zip and unzip to C:\ta-lib
TA-Lib is a 32 bit release and you might be running on a 64-bit python. So follow the instructions to build TA-Lib on 64-bit and rebuild the library.
Download and Install Visual Studio Community 20XX
Remember to Select [Visual C++] Feature
From Windows Start Menu, Start [VS20XX x64 Native Tools Command Prompt]
Go to directory: C:\ta-lib\c\make\cdr\win32\msvc
Build the Library in command prompt with this command: nmake
Now try installing again: pip install TA-Lib
you may also find other posts of similar problems here: Python TA-Lib install problems

scrapy installation error

i'm having trouble running easy_install scrapy and got the following error:
**cc1.exe: error: unrecognized command line option '-mno -cygwin'
error: setup script exited with error: command 'gcc' failed with exit status 1**
i'm running python 2.7 on windows 32 bit. i installed mingw, libxslt, liblxml2. what's going on there? Thanks!
The solution is to remove all instances of -mno-cygwin from C:\Python27\Lib\distutils\cygwinccompiler.py, re-run easy_install.
I had this same problem and I found the answer here:
http://www.techques.com/question/1-6034390/Compiling-with-cython-and-mingw-produces-gcc:-error:-unrecognized-command-line-option-'-mno-cygwin'
I had GCC version 4.6.2 installed which did not support the -mno-cygwin option.

Resources