Post-install errors while installing pywin32-216 on Windows XP - python

I'm using the pywin32-216.win32-py2.6.exe package to install pywin32 on Python 2.6.5 (r265:79096, Mar 19 2010, 21:48:26) [MSC v.1500 32 bit (Intel)] on win32. I am seeing the following post install errors. Could someone help me understand what going wrong? Thanks in advance.
Copied pythoncom26.dll to C:\WINDOWS\system32\pythoncom26.dll
Copied pythoncomloader26.dll to C:\WINDOWS\system32\pythoncomloader26.dll
Copied pywintypes26.dll to C:\WINDOWS\system32\pywintypes26.dll
FAILED to register the Python COM objects
-> Software\Python\PythonCore\2.6\Help[None]=None
-> Software\Python\PythonCore\2.6\Help\Pythonwin Reference[None]='C:\\Python26\\Lib\\site-packages\\PyWin32.chm'
Failed to register pythonwin as editor
Shortcut for Pythonwin created
Shortcut to documentation created
The pywin32 extensions were successfully installed.
Traceback (most recent call last):
File "<string>", line 372, in install
File "<string>", line 170, in RegisterCOMObjects
ImportError: No module named server.register
Traceback (most recent call last):
File "<string>", line 401, in install
File "<string>", line 226, in RegisterPythonwin
File "win32com\shell\shell.pyc", line 12, in <module>
File "win32com\shell\shell.pyc", line 10, in __load
ImportError: DLL load failed: The specified module could not be found.

Most probably pywin32 requires administrator privileges to be installed successfully. I am not sure how to do that on WinXP, but Microsoft has a page about it.

I managed to fix the problem by eventually cleaning all traces of Python 2.6 from my system and re-installing it + pywin32. It was eventually as simple as just double clicking the setup files.

Another answer for the googlers:
I has the same issue, it turns out it originated because I have installed python in the past, removed it and reinstalled it to another location.
In order to solve it I had to:
Remove old installations (Uninstall + manually from registry) - as Danish advised (both in main root and in Wow6432Node).
In the registry update the location of current location of the python folder path (in InstallPath and PythonPath).

Related

Windows Error 126 when importing xgboost into Anaconda

Although I have been using Python for a while, I am relatively new to Anaconda, and package handling in general seems to cause a lot of problems for me.
I am trying to get xgboost up and running with Anaconda. I eventually managed to install it by using the command:
conda install -c anaconda py-xgboost
in the Anaconda prompt.
When I now try import xgboost in the PyCharm Python Console, I am given the following error:
Python 2.7.15 |Anaconda 2.5.0 (64-bit)| (default, May 1 2018, 18:37:09) [MSC v.1500 64 bit (AMD64)] on win32
Backend Qt5Agg is interactive backend. Turning interactive mode on.
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "C:\Program Files (x86)\JetBrains\PyCharm Community Edition 5.0.4\helpers\pydev\pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
File "C:\Users\Richard\Anaconda2\lib\site-packages\xgboost\__init__.py", line 11, in <module>
from .core import DMatrix, Booster
File "C:\Program Files (x86)\JetBrains\PyCharm Community Edition 5.0.4\helpers\pydev\pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
File "C:\Users\Richard\Anaconda2\lib\site-packages\xgboost\core.py", line 115, in <module>
_LIB = _load_lib()
File "C:\Users\Richard\Anaconda2\lib\site-packages\xgboost\core.py", line 109, in _load_lib
lib = ctypes.cdll.LoadLibrary(lib_path[0])
File "C:\Users\Richard\Anaconda2\lib\ctypes\__init__.py", line 444, in LoadLibrary
return self._dlltype(name)
File "C:\Users\Richard\Anaconda2\lib\ctypes\__init__.py", line 366, in __init__
self._handle = _dlopen(self._name, mode)
WindowsError: [Error 126] The specified module could not be found
I have searched for similar questions on StackOverflow, but I've had no luck, besides finding complicated answers which I did not feel comfortable implementing without fully understanding, and which I am not sure are applicable to my scenario anyway.
Some further things to note, which may be related:
Originally, I installed the package using pip install xgboost in the Pycharm Terminal before realising my mistake.
When I initially tried testing the xgboost package, I did so (stupidly) in a file named xgboost.py. I have since deleted this project. I uninstalled and reinstalled xgboost afterwards.
I have tried several things to try and resolve this issue which may have complicated things further. For example, I deleted the 'xgboost' folder from inside 'C:\Users\Richard\Anaconda2' when typing conda uninstall xgboost into the Anaconda prompt failed.
Would anyone be able to shed any light on what is causing this issue? This is my first question on stack overflow, so I apologise if my question has not been posed completely correctly with regards to the guidelines.
After further searching, I managed to answer my own question.
The xgboost (C++) library must be compiled and built before it can be used as a Python module. To do so, I carefully followed the instructions on this page:
https://www.ibm.com/developerworks/community/blogs/jfp/entry/Installing_XGBoost_For_Anaconda_on_Windows?lang=en
and now, I think, xgboost is working fine. This is the first time I have encountered a package where this was required, hence the confusion. Hopefully this will help someone else who has the same issue.

Anaconda Installation error on MAc OS

I am tyying to install anaconda on my mac but at the last step of installtion it gives me following error:
installing: conda-env-2.4.5-py27_0 ...
Python 2.7.11 :: Continuum Analytics, Inc.
creating default environment...
Traceback (most recent call last):
File "/Users/sdb99/anaconda2/pkgs/conda-4.0.5-py27_0/lib/python2.7/site-packages/conda/install.py", line 37, in <module>
import subprocess
File "/Users/sdb99/anaconda2/pkgs/python-2.7.11-0/lib/python2.7/subprocess.py", line 430, in <module>
import pickle
File "/Users/sdb99/anaconda2/pkgs/python-2.7.11-0/lib/python2.7/pickle.py", line 1272, in <module>
import binascii as _binascii
ImportError: dlopen(/Users/sdb99/anaconda2/pkgs/python-2.7.11-0/lib/python2.7/lib-dynload/binascii.so, 2): Library not loaded: #loader_path/../../libz.1.dylib
Referenced from: /Users/sdb99/anaconda2/pkgs/python-2.7.11-0/lib/python2.7/lib-dynload/binascii.so
Reason: image not found
Any idea how i can get ahead from here?
Thanks!
Just update python to the next version and try installing Anaconda again.
I had python 2.7 and then I updated it to python 3 and I was able to install Anaconda graphical installer successfully.

import .vtk error in Python

I have Windows 8 64 bit and Python 2.11 64 bit. I install VTK library using pip command. It shows the following error while running:
Traceback (most recent call last):
File "<pyshell#2>", line 1, in <module>
import vtk
File "C:\Python27\lib\site-packages\vtk\__init__.py", line 72, in <module>
__helper.refine_import_err('rendering', 'vtkRenderingPython', exc)
File "C:\Python27\lib\site-packages\vtk\__helper.py", line 32, in refine_import_err
raise LinkError, str(exc)
LinkError: DLL load failed: The specified module could not be found.` Traceback
My PATH are:
C:\Python27\Lib;
C:\Python27\Lib\site-packages;
C:\Python27\Lib\site-packages\vtk;
C:\Python27\Scripts;
Thanks for your help.
I could solve the problem with uninstalling .vtk 5 and installing vtk 6.2. 0 from http://www.lfd.uci.edu/~gohlke/pythonlibs/. I also install PyQt4
In my case, the problem was resolved by adding PyQt4's directory to PATH, as suggested here. That is, the directory similar to
C:\Python27\Lib\site-packages\PyQt4
which contains the DLL that it's looking for.

Python-ldap set_option not working on Yosemite

We've installed the python-ldap(2.4.19) module without errors and perform most of the operations successfully. However ldap.set_option always returns a exception when we try to load certificates to use ssl (ldaps).
It occurs on notebooks running Yosemite but not on Mavericks or Linux. (All Macbooks have xcode installed)
We think it should be some missing/outdated/updated lib but we don't know how to find it.
Any clues?
$python
Python 2.7.6 (default, Sep 9 2014, 15:04:36)
...
>>>import ldap
>>>ldap.set_option(ldap.OPT_X_TLS_CACERTFILE, '/my_path/my_cert.crt')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/*xxx*/python2.7/site-packages/ldap/functions.py", line 133, in set_option
return _ldap_function_call(None,_ldap.set_option,option,invalue)
File "/*xxx*/python2.7/site-packages/ldap/functions.py", line 64, in _ldap_function_call
result = func(*args,**kwargs)
ValueError: option error
got around this by installing openldap threw brew, and then manually downloading the tarball, and mod setup.cfg to pick up /usr/local, and then install.
http://sourceforge.net/p/python-ldap/bugs/65/ is the ticket to add /usr/local to the defaults on python-ldap.

Installing numpy on Windows 7 and python 3.x

I can't install a library, or at least numpy. I have a Windows 7 Home Premium 64 bits and Python 3.3.3 (v3.3.3:c3896275c0f6, Nov 18 2013, 21:18:40) [MSC v.1600 32 bit (Intel)] on win32.
I go to their website to Getting Numpy which sends me to SourceForge where I download the latest (I have already update my python to 3.3) and open and install it. Apparently successfully. But when I open python and type import numpy I get:
Traceback (most recent call last):
File "<pyshell#1>", line 1, in <module>
import numpy
File "C:\Python33\lib\site-packages\numpy\__init__.py", line 168, in <module>
from . import add_newdocs
File "C:\Python33\lib\site-packages\numpy\add_newdocs.py", line 13, in <module>
from numpy.lib import add_newdoc
File "C:\Python33\lib\site-packages\numpy\lib\__init__.py", line 8, in <module>
from .type_check import *
File "C:\Python33\lib\site-packages\numpy\lib\type_check.py", line 11, in <module>
import numpy.core.numeric as _nx
File "C:\Python33\lib\site-packages\numpy\core\__init__.py", line 6, in <module>
from . import multiarray
ImportError: DLL load failed: %1 no es una aplicación Win32 válida.
The last line it means that %1 it is not a valid Win32 program.
Tere is a similar question here where they point the OP to the Windows Installer. So I download the zip file and decompress it. And now?
Somewhere I found that it should be in the Lib folder and then run the setup.py file. I tried again to import numpy but again the same error.
I found here some instructions, but the first step it is already different, my error message it is not the same, is the same as step 6. But then the step 8 is to install the 32-bits system after uninstalling numpyand Python, but there is no 32 version for Python 3.3 (or at least not that I understand). What should I do?
So I reinstall the python 3.3 I already had.
And this time when I type from numpy import * or import numpy I don't get an error but when I try to make an array I do:
Traceback (most recent call last):
File "<pyshell#4>", line 1, in <module>
type(array([1,6,3,7]))
NameError: name 'array' is not defined
Another way I found is from this source with python 3.3 which leads me to another unofficial page where I download the numpy-MKL-1.8.0.win32-py3.3 file following the steps of the blog. But still the same error of NameError.
I didn't restart the computer yet...
I forgot something else or I miss one step?
So, after rebooting it seems to work well. I post here what worked for me
Install python for just for me. Download from here the library, install the latest (or the version you want) with 32 bites even if the computer is 64 bites and restart the computer.
Christophe Gohlke maitains an extensive collection of windows binaries for various python libraries including numpy. Have you tried here?
/www.lfd.uci.edu/~gohlke/pythonlibs/

Categories