ValueError: Symbol table not found - numpy

I'm trying to install scikit-learn; following the instructions, I downloaded the source and attempted to install it with python setup.py install, however the installation is interrupted at:
File "C:\Users\Alpine\Anaconda\lib\site-packages\numpy\distutils\mingw32ccompi
ler.py", line 278, in generate_def
raise ValueError("Symbol table not found")
ValueError: Symbol table not found
I've also tried using easy_install -U scikit-learn, although end up with the same error.
Using conda install scikit-learn appeared to install the conda-3.4.1-py27_0.tar.bz2 and numpy-1.8.1-py27_0.tar.bz2 packages, and for safe measure I ran conda update anaconda, although I'm still receiving the same error.
Would anybody know how to work around this?

This solution will take care of "symbol table not found" error from numpy (or any other package ) on windows machine
sklearn people have provided good solution for this over here
http://scikit-learn.org/stable/developers/advanced_installation.html#building-on-windows
you can find instruction for Linux and mac on same page
now just follow these steps
32-bit Python
For 32-bit python it is possible use the standalone installers for microsoft visual c++ express 2008 for Python 2 or Microsoft Visual C++ Express 2010 for Python 3.
Once installed you should be able to build scikit-learn without any particular configuration by running the following command in the scikit-learn folder:
python setup.py install
64-bit Python
For the 64-bit architecture, you either need the full Visual Studio or the free Windows SDKs that can be downloaded from the links below.
The Windows SDKs include the MSVC compilers both for 32 and 64-bit architectures. They come as a GRMSDKX_EN_DVD.iso file that can be mounted as a new drive with a setup.exe installer in it.
**For Python 2 you need SDK v7.0: MS Windows SDK for Windows 7 and .NET Framework 3.5 SP1 -> https://www.microsoft.com/en-us/download/details.aspx?id=18950
For Python 3 you need SDK v7.1: MS Windows SDK for Windows 7 and .NET Framework 4** -> (can't post link as i need atleast 10 reputation point )
Both SDKs can be installed in parallel on the same host. To use the Windows SDKs, you need to setup the environment of a cmd console launched with the following flags (at least for SDK v7.0):
cmd /E:ON /V:ON /K
Then configure the build environment with:
SET DISTUTILS_USE_SDK=1
SET MSSdk=1
"C:\Program Files\Microsoft SDKs\Windows\v7.0\Setup\WindowsSdkVer.exe" -q -version:v7.0
"C:\Program Files\Microsoft SDKs\Windows\v7.0\Bin\SetEnv.cmd" /x64 /release
after typing above commands in cmd as soon as you hit enter the window will be changed lil bit ( font color changed to green ) now go to directory where you have downloaded sklearn zip file from git hub then un-zip it
and go to directory where you can find setup.py
run command
python setup.py install
if it's not recognizing python then you migh have missed this command
cmd /E:ON /V:ON /K
so till now if u have done everything correct then your package will be installed without any difficulties

Related

OSError: WinError 193 %1 is not a valid Win32 application

I have been working on a project in Visual Studio Code with Python 3.8.5, and I have a windows 64 bit operating system. I decided to upgrade to Python 3.11.1, and downloaded the official 64 bit installer and followed the instructions. All the packages I import at the beginning of my project that were previously working now give this error "[WinError 193] %1 is not a valid Win32 application" when I run the import statements for them.
For some of the packages (pandas, numpy, matploblib) this was solved by using an approach I saw on a few similar questions to this, by opening the command prompt and typing "pip uninstall pandas" etc and then doing "pip install pandas".
However, for the other packages (sklearn, umap, nltk), this isn't working even after trying that process a few times. I've also tried updating pip. Does anybody have any ideas on what could be causing this to work for some packages but not for others? It allows me to install all of the packages via the command prompt, the issue only arises when I actually try and import them via VSCode, and it's the same error for every package. I've seen some suggestions saying to ensure the environment path is clean, but I'm still quite a beginner so I'm a bit unsure as to what that means.
Any help would be really appreciated.

Install pymssql 2.1.3 in Pycharm

I'm working with Pycharm in a project to read SQL DBs ,I'm working in a windows 10 64bits workstation and I'm trying to install the module pymssql, I have already installed VS2015 to get all requirements but now each time that i try to install i got the message:
error: command 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\cl.exe' failed with exit status 2
I saw on message details the error in:
_mssql.c(266): fatal error C1083: Cannot open include file: 'sqlfront.h': No such file or directory
How can i figured it out? thanks
Seems that your error is a known problem, check here.
As you can see from the last post from the link, they don't have wheels built for Python3.6, so when you try to install pymssql, the error is raised.
Still, as the post found suggests, you can try the following options:
Drop back to Python 3.5
Use the Python 3.6 wheels available here:
Try to build pymssql using the advice given in the forum link above.
If you were trying to install pymssql directly from PyCharm, I think that you should follow the options showed above but from command line
For anyone that is seeing this in 2021, pymssql only supports python 3.7 according to their own build files. Don't bother trying to use it if you are on 3.8 or higher. I'm on 3.9.1
Use pyodbc instead. This install worked right out of the box using windows server 2016 after spending about 3 hours of digging.
pip install pyodbc
hope that saves you a ton of grief...
I had the same problem and I fixed this way.
Download pymssql module from https://www.lfd.uci.edu/~gohlke/pythonlibs/#pymssql. place the .whl file in the C:\Python38-32 folder.
Open cmd.exe
Run
cd C:\Python38-32
pip install pymssql-2.1.4-cp38-cp38-win32.whl
I had a same problem but its fixed this way.
Copied "rc.exe" and "rcdll.dll" from "C:\Program Files (x86)\Windows Kits\8.1\bin\x86"
Pasted "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin"
In my case helped me rollback to Python 3.8. Same problem I had on 3.10 x64

SCIP Python Installation Issue Windows with pip

Hello community / developers,
I am currently trying to install SCIP with python and found that there is Windows Support and a pip installer based on https://github.com/SCIP-Interfaces/PySCIPOpt/blob/master/INSTALL.md.
Nevertheless I run into a problem "Cannot open include file"
Below is a list of the things I performed to get to this step.
Download Python Anaconda 2.7 64 bit
Install with all checkboxes as they are
Download PyCharm Community edition
Click 64 bit desktop link, and associate with .py checkboxes
Open CMD > write: easy_install -U pip
Download Visual C++ Compiler for Python 2.7
Setup folder structure and downloaded header files
CMD > pip install pyscipopt leads to error:
C:\Users\UserName\Downloads\SCIPOPTDIR\include\scip/def.h(32) : fatal error C1083: Cannot open include file: 'stdint.h': No such file or directory
error: command 'C:\Users\UserName\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\cl.exe' failed with exit status 2
My environment variables and folder directory can be found here:
http://imgur.com/a/mJRva
Help is very much appreciated,
Kind regards
The error message says your missing "stdint.h". This is because you don't have a recent Visual Studio version. You probably use the one that came with your Python installation. Try installing the latest Visual Studio to fix this issue.
You might want to look at this question:
Why Microsoft Visual Studio cannot find <stdint.h>?
PySCIPOpt needs a C/C++ linker to build the Python module - although it's already precompiled on PyPI.
Alright, I figured it out. I needed to
(1) Install Python 3.6 instead of Python 2.7 (both Anaconda)
(2) Afterwards pip installation worked
(3) I moved the library files in the lib folder
(4) Now I can execute the examples.
Interestingly, I get an unresolved reference error although the code works fine (I assume this is a bug of Pycharm/scipy?) Link to picture: https://www.dropbox.com/s/d8pf6dkwuz9cwto/scip_python.png?dl=0

How do install pyopencl using INDE instead of OpenCL SDK?

I'm a python newbie and I'm trying to install pyopencl. I've found Andreas Klöckner's website. And I'm trying to use the Windows 7 64bit, Python 2.7, Visual Studio 2010, Intel OpenCL SDK 1.5 directions to install. The problem is that Intel OpenCL SDK has been integrated into INDE. So I'm wondering what the equivalent library file is for C:\Program Files (x86)\Intel\OpenCL SDK\1.5\include and C:\Program Files (x86)\Intel\OpenCL SDK\1.5\lib\x64 ? After installing INDE, I didn't see anything under that specific file location.
Under C:\Intel\INDE, if I just look for folders that contain libraries I saw the code_builder_5.0.0.43 (contains OpenCL), IDEintegration (contains a bunch of stuff), the media_raw_accelerator_1.0.3, media_sdk_6.0.0.308. Anyone know which one I should be using?
It's 'C:\Intel\INDE\code_builder_5.0.0.43\include' and 'C:\Intel\INDE\code_builder_5.0.0.43\lib\x64'
Let me add a few points that could be useful to others who want to use PyOpenCL on Windows. First, if you are not a Python developer, you will want to use the Intel OpenCL Code Builder. When you install the INDE Suite, you integrate in Visual Studio and you get all the syntax highlighting amongst others. This video gives a great overview: http://bcove.me/xrcs5bze
The latest OpenCL 2.0 (as of time of writing) is now part of OpenCL Code Builder. In order to access the OpenCL framework to use with PyOpenCL, do the following installation on Windows (if not yet done):
Detailed instructions can be found here: http://wiki.tiker.net/PyOpenCL/Installation/Windows
Install Visual Studio
Install Python 2.7
Install NumPy
Install PyOpenCL
Install Intel INDE (OpenCL Code Builder component)
Once this is done, locate the siteconf.py file and edit accordingly. On my machine, I have INDE Update 2 which comes with OpenCL Code Builder 5.1.0.25 installed.
Thus, the following lines are edited:
CL_INC_DIR = [r'C:\Intel\INDE\code_builder_5.1.0.25\include']
CL_LIB_DIR = [r'C:\Intel\INDE\code_builder_5.1.0.25\lib\x64', r'C:\Intel\INDE\code_builder_5.1.0.25\lib\x86']
I hope that helped.

MonoDevelop command line compile a solution

The problem is as follows: I have a MonoDevelop project (ASP.NET) on my development workstation.
I'm currently at a customer site, without my regular development environment on my laptop (Regulatory Burden). I have SSH access to my development workstation, but the network is too laggy to handle X11 comfortably.
I need to make a minor adjustment and recompile. I tried using xbuild, with no effect:
qdot#trigati ~/svn/proj/trunk/proj $ xbuild proj.csproj
XBuild Engine Version 2.6.4.0
Mono, Version 2.6.4.0
Copyright (C) Marek Sieradzki 2005-2008, Novell 2008-2009.
MSBUILD: error MSBUILD0000: /home/qdot/svn/proj/trunk/proj/proj.csproj: Imported project:
"/usr/lib/mono/xbuild/Microsoft/VisualStudio/v8.0/WebApplications/Microsoft.WebApplication.targets" does not exist.
Is there some utility that can trigger a rebuild of the monodevelop sourcecode? Obviously the code builds through the GUI.
mdtool build proj.csproj
If you want to use xbuild, create a symlink:
cd /usr/lib/mono/xbuild/Microsoft/VisualStudio/v9.0
ln -s v9.0 v10.0
I have the same exact ubuntu 12.04 distro on two different computers and could not figure out why mono would compile on one computer and not the other. But oh well, symlink solved the problem.