Archive

Archive for January, 2012

“Python Version 2.7 required which was not found in the registry”

January 15th, 2012 3 comments


Introduction
Any module installer that is created using distutils (bdist_wininst) is very likely to produce this error. The problem is that it only detects 32bit installations of Python on 64bit Windows machines. Or more technically, 32bit versions of Python create the following registry path

HKEY_LOCAL_MACHINE\Software\Wow6432Node\Python\PythonCore

while 64bits versions create a slightly other registry path which is

HKEY_CURRENT_USER\Software\Python\PythonCore

When any 32-bit module setup is started (with a Python 64-bit on your system), it first checks whether the first path exists, while instead it should check the second (which does exist).

There are basically three ways of solving this:

  • You can install a 32-bit Python version
  • or install a 64-bit version of your module
  • or adjust the registry such that it really sees that a 64bit Python is installed

I will of course elaborate on the last two options.

Install a 64-bit version of your module

You can find many module binaries here. Choose a 64-bit version and install it. This is the most clean way of fixing the problem.

If your module is not in the list, then try the alternative below.

Fix by adjusting the registry

So the dirty way is to do the following adjustments in the registry:

  1. Run regedit.
  2. Locate the path: HKEY_CURRENT_USER\Software\Wow6432Node\
  3. Create keys in this path: Python\PythonCore\2.7\InstallPath
  4. Modify the “(Default)“, which is initially empty, to the path where Python is located, for example “C:\Python27\”.
  5. You are done. Exit and retry the setup that gave the error.

You can alternatively create a .reg file (for example fix.reg) that will do the above steps automatically. Put exactly the following in it:

Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Python\PythonCore\2.7\InstallPath]
@="C:\\Python27\\"

If you are lazy, then you can also download this file, unpack the registry file and just run it.

 

Categories: Fixes, Python Tags:

“Unable to find vcvarsall.bat” error when trying to install lxml

January 15th, 2012 No comments

I needed the lxml library on a machine for some python script that I coded earlier. I tried using easy_install by doing

easy_install lxml

but then I got the following error:

Searching for lxml
Reading http://pypi.python.org/simple/lxml/
Reading http://codespeak.net/lxml
Best match: lxml 2.3.3
Downloading http://lxml.de/files/lxml-2.3.3.tgz
Processing lxml-2.3.3.tgz
Running lxml-2.3.3\setup.py -q bdist_egg --dist-dir c:\users\edin\appdata\local\
temp\easy_install-9sxhlm\lxml-2.3.3\egg-dist-tmp-pjbtkm
Building lxml version 2.3.3.
Building without Cython.
ERROR: 'xslt-config' is not recognized as an internal or external command,
operable program or batch file.

** make sure the development packages of libxml2 and libxslt are installed **

Using build configuration of libxslt
warning: no files found matching 'lxml.etree.c' under directory 'src\lxml'
warning: no files found matching 'lxml.objectify.c' under directory 'src\lxml'
warning: no files found matching 'lxml.etree.h' under directory 'src\lxml'
warning: no files found matching 'lxml.etree_api.h' under directory 'src\lxml'
warning: no files found matching 'etree_defs.h' under directory 'src\lxml'
warning: no files found matching 'pubkey.asc' under directory 'doc'
warning: no files found matching 'tagpython*.png' under directory 'doc'
warning: no files found matching 'Makefile' under directory 'doc'
error: Setup script exited with error: Unable to find vcvarsall.bat

I tried installing libxml2 and libxslt, but it resulted in similar errors.

Searching for libxml2
Reading http://pypi.python.org/simple/libxml2/
Couldn’t find index page for ‘libxml2′ (maybe misspelled?)
Scanning index of all packages (this may take a while)
Reading http://pypi.python.org/simple/
No local packages or download links found for libxml2
Best match: None
Traceback (most recent call last):
File “C:\Python27\Scripts\easy_install-script.py”, line 8, in
load_entry_point(‘setuptools==0.6c11′, ‘console_scripts’, ‘easy_install’)()
File “C:\Python27\lib\site-packages\setuptools-0.6c11-py2.7.egg\setuptools\com
mand\easy_install.py”, line 1712, in main
File “C:\Python27\lib\site-packages\setuptools-0.6c11-py2.7.egg\setuptools\com
mand\easy_install.py”, line 1700, in with_ei_usage
File “C:\Python27\lib\site-packages\setuptools-0.6c11-py2.7.egg\setuptools\com
mand\easy_install.py”, line 1716, in
File “C:\Python27\lib\distutils\core.py”, line 152, in setup
dist.run_commands()
File “C:\Python27\lib\distutils\dist.py”, line 953, in run_commands
self.run_command(cmd)
File “C:\Python27\lib\distutils\dist.py”, line 972, in run_command
cmd_obj.run()
File “C:\Python27\lib\site-packages\setuptools-0.6c11-py2.7.egg\setuptools\com
mand\easy_install.py”, line 211, in run
File “C:\Python27\lib\site-packages\setuptools-0.6c11-py2.7.egg\setuptools\com
mand\easy_install.py”, line 434, in easy_install
File “C:\Python27\lib\site-packages\setuptools-0.6c11-py2.7.egg\setuptools\pac
kage_index.py”, line 475, in fetch_distribution
AttributeError: ‘NoneType’ object has no attribute ‘clone’

In one of my previous posts I pointed out how you can solve a similar problem with a missing vcvarsall.bat error, but unfortunately that approach did not solve my problem. Compiling the sources from the ground up was a too intensive job (which I might try to figure out in the future), so I chose the easy path.

The issue was solved by installing these packages from this site which lists a lot of (unoffical) Windows binaries for Python. Everything suddenly started to work as it should. :)

Categories: Fixes, Python Tags:

How to send large files using µTorrent

January 14th, 2012 No comments

Introduction

There are numerous ways to share your files. This includes the usual mail, Windows Live Messenger, file-hosting sites like RapidShare, Dropbox, FTP and many other ways.

However, all have the following problem. Lets say that you want to share some REALLY big amount of data with someone, like for example 5GB or maybe even 20GB. In that case all of the above mentioned ways of sharing have serious drawbacks.

Windows Live Messenger is often very slow, can share only a few files at a time and does not support resume on sending files (which basically means that if for example your connections dies out while having 99% of your file already sent, you have to send the file all over again!). File-hosting sites like RapidShare, MegaUpload and similar sites have file size limits so that you need to upload big files by splitting it in different parts that are withing this limit  and so on (which is also the case if you use Dropbox). FTP does not pose a limit on the number or size of the files, but it again does not offer a resume of a download like Windows Live Messenger. Other drawbacks of all these type of methods  is the requirement of some initial setup, technical knowledge, user registration on websites, ads, etc.

Read more…

Categories: Tutorials Tags:

Cannot Install Microsoft .NET Framework 3.5 SP1

January 4th, 2012 No comments

There might be several reasons as to why you can’t install the .NET Framework. I had the problem while installing the framework via the Windows Update.

Symptoms
While trying to install Microsoft .NET Framework 3.5 SP1 Update for Windows 7 x86 (KB982526), Windows Update told me that the update was unsuccessful and gave me the following “useful” error:

“WindowsUpdate_800F081F” “WindowsUpdate_dt000″

You might also get several other errors similar to the following:

  • an error of type 0×643
  • Microsoft .NET Framework 3.5 (x64) ‘package’: [2] Error: Installation failed for component Microsoft .NET Framework 3.5 (x64) ‘package’. MSI returned error code 1601
  • Microsoft .NET Framework 3.5 (x64) ‘package’: [2] Error: Installation failed for component Microsoft .NET Framework 3.5 (x64) ‘package’. MSI returned error code 1603
  • Microsoft .NET Framework 3.0SP1 (x64) (CBS): [2] Error: Installation failed for component Microsoft .NET Framework 3.0SP1 (x64) (CBS). MSI returned error code -2146762496
  • WapUI: [2] DepCheck indicates Microsoft .NET Framework 2.0SP1 (CBS) is not installed
Regarding the installation via Windows Update, you might furthermore experience problems with installing Windows Internet Explorer 9 for Windows 7 by getting an error similar to this:

“WindowsUpdate_00009C47″ “WindowsUpdate_dt000″

Solution(s)
It strongly depends on the situation and your system but you might try one of the following solutions:

  • You can first try to install the System Update Readiness Tool for Windows 7 which is an August 2011 release (KB947821 - 32-bit (x86)) at this moment of writing. This should solve any inconsistencies in the Windows servicing store which may prevent the successful installation of future updates, service packs, and software. There is also a 64-bit version for Windows 7. Windows Vista: 32-bit (x86), 64-bit (x64).
  • If you’re not using Windows Update, then you can try to download and install the framework manually: Microsoft .NET Framework 3.5 Service Pack 1.
  • There is also a newer version of the framework which most newer applications use which might also suffice: Microsoft .NET Framework 4 (Web Installer).
  • Another thing that you can try on top of all the above is to first remove all the existing .NET framework versions. Do it via Add or remove programs from the Configuration Panel. You can also try the .NET Framework Cleanup Tool.
  • Do the following: Start > Run > type “services.msc”. Now check whether the Startup Type of Windows Installer is set to Manual.
  • Go to Start > Control Panel > Programs > Turn Windows features on or off. Check now that the Microsoft .NET Framework 3.5.1 is checked on.
  • Disable any security/antivirus software while trying to install. Usually this shouldn’t give problems, but it’s worth a try.
If you still didn’t fix your problem, you can start a discussion in the comments below. If you fixed it in another way, then please share it and I’ll add it to the list above.
Categories: Fixes, Windows Tags: