29. September 2021

Eclipse error AutoRegisterSchemeHandlersJob AppData\Local\Temp\jna Can’t find dependent libraries

Windows users might experience a very strange errors when starting Eclipse:

An internal error occurred during: "AutoRegisterSchemeHandlersJob".
C:\Users\Vrtižer\AppData\Local\Temp\jna--78847768\jna6432107568184066435.dll: Can't find dependent libraries

It’s possible to continue with the error, but the majority of Eclipse plugins won’t work.

When you look closely at the path you can see there is a special character in the word ‘Vrtižer‘. This special character with a combination of Windows feature ‘Use Unicode UTF-8 for worldwide language support‘ causes the issue.

There are several ways how to workaround the problem:

#1 Change the user environment variable TMP

Open Start, type: environment

Select Edit system environment variables

Click Environment Variables…

Select User variable with name TMP and change it to path without special character, the path must exist.

Click Ok. Start new Eclipse.

Note: the default values is

%USERPROFILE%\AppData\Local\Temp

#2 Remove the user environment variable TMP

If you do not have a special need for user-specific TMP, you can simply delete it. The system will default to System Temp.

Steps are the same as in #1, just instead of Edit, click Detete to remove the variable

Click Ok. Start new Eclipse.

#3 Disable Windows feature ‘Use Unicode UTF-8 for worldwide language support’

Open Start, search for Region settings, click Additional date, time & regional settings, click Change system locale…

Uncheck Use Unicode UTF-8 for worldwide language support, click Ok and restart the computer.

Note: disabling this setting might affect communication between PowerShell and Python scripts in the case of strings with diacritics.

Update: Issue reported to Eclipse.org.

20. August 2012

Problems with deploying Heroku Django app from Windows

Deploying Django app to Heroku from Windows machine is little bit tricky.

You can follow instructions in Heroku manual. The first problem that you may encounter is with Postgres support in Python. There is problem with this command:

pip install Django psycopg2 dj-database-url

If you do not have Visual Studio installed on your machine, you’ll receive error that vcvarsall.bat is missing.

Solution is quite easy. You don’t need to install Visaul Studio. Just download binary version of psycopg2 module from http://www.stickpeople.com/projects/python/win-psycopg/

Then you can exclude psycopg2 from pip install command, because it is installed in system directory of Python.

Another tricky issue is with command:

pip freeze >requirements.txt

If you type this command in PowerShell then it will automatically create Unicode file with extra bytes. When you try to deploy project with messed requirements.txt to Herou then you’ll see self explanatory error ;-)

TypeError: must be encoded string without NULL bytes, not str

Nice :-)

Just open requirements.txt file with notepad and select Save as. In Save as dialog choose ANSI.

Commit file and push project to Heroku. It will work ;)