Installing python modules in TideSDK - windows

I am trying to install an external dependency into Python for TideSDK. The current module I am trying to install is redis-py.
To install it I tried the following steps:
Open Command Prompt in regular administrative mode
Change directory to the downloaded module of redis-py
Provide the path to the python module used by TideSDK followed by the standard compile and install from source command prompt. The command I used: "C:\Program Files (x8
6)\TideSDK Developer\modules\python\1.3.1-beta\python.exe" setup.py install
The setup looked very promising. The redis-py module with egg file is confirmed to be installed by both the installer with exited with no errors and with a visual check on the directory.
So what gives? The correct files are installed in Lib/site-packages. TideSDK gives me ImportError: No module named redis. Any suggestions?

I solved it for another module: simplejson.
I guess the workaround should work for any module of this kind.
BTW, simplejson may be used to support json, as the actual version (TideSDK 1.3.1-beta) comes with Python 2.5 which doesn't support the standard json module, it comes in Python 2.6 (or higher).
First, the path you are using is for "TideSDK Developer", that's the program to launch and build apps. It happens that "TideSDK Developer" is built using TideSDK, so the structure is the same.
C:\Program Files (x8 6)\TideSDK
Developer\modules\python\1.3.1-beta\python.exe
The path that TideSDK actually uses to launch and compile apps is inside "C:\ProgramData"
In my case, it's:
C:\ProgramData\TideSDK\modules\win32\python\1.3.1-beta\python.exe
So, this is what I did, I ran:
C:\ProgramData\TideSDK\modules\win32\python\1.3.1-beta\python.exe setup.py install
That "installs" the module, but installs it inside "site-packages". So, when I launched the app I got the same error ("no module named simplejson"), I then copied the module from inside "site-packages" to outside.
I copied from:
C:\ProgramData\TideSDK\modules\win32\python\1.3.1-beta\Lib\site-packages\simplejson
to:
C:\ProgramData\TideSDK\modules\win32\python\1.3.1-beta\Lib\simplejson
And that's it. That worked for me.
In summary: Go to ProgramData, install with python and copy the folder installed inside site-packages.

Related

pycharm swig how to? [windows]

I would require some guidance in regards to installing a module/package in pycharm (free edition). I have to mention that i have not worked with this IDE yet and wanted to try it out on a little project containing smartcards.
When i try to install "pyscard" i get the error that boils down to
error: command 'swig.exe' failed: No such file or directory
People say just install SWIG, which i guessed already ^^.
The issue i have is that i actually have no idea how to... and none of the pages i found has really enlightended me on this issue.
I downloaded the zip "swigwin-3.0.12" but i am at a loss what to do with it now. EDIT: According to the SWIG page this is an already compiled version and i have to somehow make pycharm recognize that the folder it is in contains the swig.exe it requires.
EDIT2: Adding the folder containing the swig.exe to the PATH variable also did not work ... which i thought would be the issue
EDIT3+Answer:
Ok the link in the comments from "wp78de" was correct my problem was that pycharm/pc restart were needed for it to catch the added PATH variable to the swig.exe (for pycharm that is)
Any advice is appriciated.
Envoirment:
Windows 8.1 Pro 64-bit
Pycharm 2017.2.4
Python 3.6
Basically, you just have to add the directory that contains the swig executable the PATH environment variable. You can do it via CMD or the Windows UI.
If you have added swig to your path, you should be able to call it in the command prompt from any directory: open "cmd", and type swig --help" on that prompt.
A restart of PyCharm (or whatever your IDE is) and Windows might be required.

How to install Ruby Installer in Azure Websites

I'm using SASS in my application and i'm in the process of migrating to Azure.
I've got my project setup but it's not compiling the SASS. I'm trying to use the Ruby Installer from here http://rubyinstaller.org/downloads/ (Ruby 1.9.3-p551) and I've uploaded this via FTP to D:/home however when I try to install it simply using the command rubyinstaller-1.9.3-p551.exe it doesn't do anything. No error message or anything either.
Any suggestions?
Using the installer won't work because it probably requires an interactive session. What I did was get the Ruby binaries and FTP those to the website. You can find the binaries as as 7zip file on Ruby download page. I followed along this post: Installing Ruby 1.8.7 (and other stuff) manually. The part about zlib is probably outdated because there is a corresponding dll in the zipped archive already. I did download the other mentioned dll though (the iconv dll) and placed it in the Ruby bin folder.
Gem is already bundled in the package so no need to install that separately.
Unfortunately now I'm having difficulties in getting the gulp task to work because it is still saying "ruby and compass must be installed and in path". I set the path in the gulpfile.
You no longer need to depend on Ruby to compile your SASS.
LIBSASS has 100% parity with RUBY SASS, and doesn't come with the Ruby dependency.
If you're using grunt, you can switch over to LIBSASS by editing your gruntfile.js to use
grunt.loadNpmTasks('grunt-sass');
instead of
grunt.loadNpmTasks('grunt-contrib-sass');
You should also update your package.json file accordingly.
You can then get Azure to execute your grunt tasks as explained in this answer.

How do I build cx_freeze from source on Windows?

I tried to install cx_freeze on my computer (windows) with an MSI, but the installation kept failing saying something like "one or more needed files could not be found." Because installing from a prebuilt binary wasn't an option, I decided to build cx_freeze from source.
I downloaded the .tar.bz and extracted until I got to the actual folder containing the setup.py. I cded into the directory, and ran the command
python setup.py install
A cmd windows came up and printed out a lot of text along the lines of "adding base module named...",then printed out
running install
running build
running build_py
However, the install then failed with the error
error: package directory 'cx_freeze' does not exist
I have no idea how to solve this. If someone could give me working instructions on how to install cx_freeze that would be great
BTW, I'm on python 3.3
After struggling around for 1 and a half hour I found the solution!
I followed these steps to compile CX_Freeze from source for Python 3.3:
install visual studio 2010 c++ (only 2010 works!)
Download the latest version of CX_Freeze from BitBucket. You need this one, the version on the main page of CX_Freeze misses one file! https://bitbucket.org/anthony_tuininga/cx_freeze
Extract the file
Launch cmd and cd to the directory of the extracted folder. (This will avoid your problem)
(optional: path to python.exe) setup.py install
Done!
During this I faced one major issue. There where some problems with mt.exe and it failed with exit status 31.
The solution is to go to you python and edit msvc9compiler.py in Lib/distutils.
Search for the following line:
ld_args.append(‘/MANIFESTFILE:’ + temp_manifest)
replace it by:
ld_args.append(‘/MANIFEST’)
sources which helped me:
http://fuyun.org/2009/12/install-mysql-for-python-on-windows/
http://grokbase.com/t/python/tutor/03be598tkx/how-to-install-new-package#20031115zd5eiqq27cbflktokjw4esr4g4

GAE Go Windows - "Cannot run program", "is not a valid Win32 application"

I've been trying to run a GAE Go project I developed on my Mac on my Windows machine with GoClipse after installing and configuring the appropriate SDKs and so forth. When attempting to run the project, I get this error:
Exception occurred executing command line. Cannot run program
"C:\GoogleAppEngine\dev_appserver.py" (in directory
"D:\Golang\workspace\Project\src\pkg"): CreateProcess
error=193, %1 is not a valid Win32 application
How can I fix that error in order to run my project?
While the below configuration works on the Mac as it has Python installed by default, Windows requires a different configuration.
On Mac the GoClipse External Tools Configuration would be:
Location: /GoogleAppEngine/dev_appserver.py
Working Directory: ${workspace_loc:/Project/src/pkg}
Arguments: .
The Windows configuration should look like:
Location: C:\Python27\Python.exe
Working Directory:
Arguments: C:\GoogleAppEngine\dev_appserver.py "${workspace_loc:/Project/src/pkg}"
Trying to run .py (Which IMO is a Python file?) wont work directly on windows. You will need to install Python and then pass the above filename to Python something like (I don't know Python so don't go by exact syntax, you might need to look around)
python "C:\GoogleAppEngine\dev_appserver.py
The reason it's working on Mac is because Python comes pre-installed on mac as cited here But on windows it doesn't. So you can install Python and add the Python's bin folder to path, and then run above script and it should run fine!

How to install pkg config in windows?

I am trying to do it, but all I can get is some source code that I don't know how to do deal with I downloaded from http://pkgconfig.freedesktop.org/releases/.
This is a step-by-step procedure to get pkg-config working on Windows, based on my experience, using the info from Oliver Zendel's comment.
I assume here that MinGW was installed to C:\MinGW. There were multiple versions of the packages available, and in each case I just downloaded the latest version.
go to http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/
download the file pkg-config_0.26-1_win32.zip
extract the file bin/pkg-config.exe to C:\MinGW\bin
download the file gettext-runtime_0.18.1.1-2_win32.zip
extract the file bin/intl.dll to C:\MinGW\bin
go to http://ftp.gnome.org/pub/gnome/binaries/win32/glib/2.28
download the file glib_2.28.8-1_win32.zip
extract the file bin/libglib-2.0-0.dll to C:\MinGW\bin
Now CMake will be able to use pkg-config if it is configured to use MinGW.
Get the precompiled binaries from http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/
Download pkg-config and its depend libraries :
pkg-config_0.26-1_win32.zip
glib_2.28.8-1_win32.zip
gettext-runtime_0.18.1.1-2_win32.zip
A alternative without glib dependency is pkg-config-lite.
Extract pkg-config.exe from the archive and put it in your path.
Nowdays this package is available using chocolatey, then it could be installed with
choco install pkgconfiglite
I did this by installing Cygwin64 from this link https://www.cygwin.com/
Then - View Full, Search gcc and scroll down to find pkg-config.
Click on icon to select latest version.
This worked for me well.
I would like to extend the answer of #dzintars about the Cygwin version of pkg-config in that focus how should one use it properly with CMake, because I see various comments about CMake in this topic.
I have experienced many troubles with CMake + Cygwin's pkg-config and I want to share my experience how to avoid them.
1. The symlink C:/Cygwin64/bin/pkg-config -> pkgconf.exe does not work in Windows console.
It is not a native Windows .lnk symlink and it won't be callable in Windows console cmd.exe even if you add ".;" to your %PATHEXT% (see https://www.mail-archive.com/cygwin#cygwin.com/msg104088.html).
It won't work from CMake, because CMake calls pkg-config with the method execute_process() (FindPkgConfig.cmake) which opens a new cmd.exe.
Solution: Add -DPKG_CONFIG_EXECUTABLE=C:/Cygwin64/bin/pkgconf.exe to the CMake command line (or set it in CMakeLists.txt).
2. Cygwin's pkg-config recognizes only Cygwin paths in PKG_CONFIG_PATH (no Windows paths).
For example, on my system the .pc files are located in C:\Cygwin64\usr\x86_64-w64-mingw32\sys-root\mingw\lib\pkgconfig. The following three paths are valid, but only path C works in PKG_CONFIG_PATH:
A) c:/Cygwin64/usr/x86_64-w64-mingw32/sys-root/mingw/lib/pkgconfig -
does not work.
B) /c/cygdrive/usr/x86_64-w64-mingw32/sys-root/mingw/lib/pkgconfig -
does not work.
C) /usr/x86_64-w64-mingw32/sys-root/mingw/lib/pkgconfig - works.
Solution: add .pc files location always as a Cygwin path into PKG_CONFIG_PATH.
3) CMake converts forward slashes to backslashes in PKG_CONFIG_PATH on Cygwin.
It happens due to the bug https://gitlab.kitware.com/cmake/cmake/-/issues/21629. It prevents using the workaround described in [2].
Solution: manually update the function _pkg_set_path_internal() in the file C:/Program Files/CMake/share/cmake-3.x/Modules/FindPkgConfig.cmake. Comment/remove the line:
file(TO_NATIVE_PATH "${_pkgconfig_path}" _pkgconfig_path)
4) CMAKE_PREFIX_PATH, CMAKE_FRAMEWORK_PATH, CMAKE_APPBUNDLE_PATH have no effect on pkg-config in Cygwin.
Reason: the bug https://gitlab.kitware.com/cmake/cmake/-/issues/21775.
Solution: Use only PKG_CONFIG_PATH as an environment variable if you run CMake builds on Cygwin. Forget about CMAKE_PREFIX_PATH, CMAKE_FRAMEWORK_PATH, CMAKE_APPBUNDLE_PATH.
Install mingw64 from https://sourceforge.net/projects/mingw-w64/. Avoid program files/(x86) folder for installation. Ex. c:/mingw-w64
Download pkg-config__win64.zip from here
Extract above zip file and copy paste all the files from pkg-config/bin folder to mingw-w64. In my case its 'C:\mingw-w64\i686-8.1.0-posix-dwarf-rt_v6-rev0\mingw32\bin'
Now set path = C:\mingw-w64\i686-8.1.0-posix-dwarf-rt_v6-rev0\mingw32\bin
taddaaa you are done.
If you find any security issue then follow steps as well
Search for windows defender security center in system
Navigate to apps & browser control> Exploit protection settings> Program setting> Click on '+add program customize'
Select add program by name
Enter program name: pkgconf.exe
OK
Now check all the settings and set it all the settings to off and apply.
Thats DONE!
Another place where you can get more updated binaries can be found at Fedora Build System site. Direct link to mingw-pkg-config package is: http://koji.fedoraproject.org/koji/buildinfo?buildID=354619
for w64-based computers you have to install mingw64. If pkg-config.exe is missing then, you can refer to http://ftp.acc.umu.se/pub/gnome/binaries/win64/dependencies/
Unzip and copy/merge pkg-config.exe into your C:\mingw-w64 installation, eg. into on my pc into C:\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\bin
In 2022 VS Code works with CMake & pkgconfig out of the box (add pkgconf && vcpkg-pkgconfig-get-modules to your vcpkg.json)
From: https://github.com/JoinMarket-Org/joinmarket/wiki/Installing-JoinMarket-on-Windows
This guide describes how to install JoinMarket and its dependencies (python, libsodium, secp256k1) on Windows.
Some or all of this may or may not work for all versions of Windows. Reports appreciated. It is not claimed to be in any way comprehensive. Verification of downloads are your own responsibility.
Install JoinMarket - go to https://github.com/JoinMarket-Org/joinmarket/releases and download the most recent release. Unzip it into any location you choose.
You will need to install MinGW from here or go to their website. After a few introductory screens, you will be shown a windows with some optional components that you have to choose; this basic setup is sufficient:
From "Basic Setup" in the left menu:
mingw-developer-toolkit
mingw32-base
mingw32-gcc-g++
msys-base
Once you have chosen these, choose "Update" from the main menu first item. These components will be installed into C:\MinGW\bin. Once that is complete, you should have this dll: libgcc_s_dw2-1.dll in that folder C:\MinGW\bin, along with a lot of other files; I'm mentioning this file explicitly, since it's needed specifically for libsecp256k1 to operate in this setup.
Next, you must make sure C:\MinGW\bin is added to your PATH variable. Here's one guide to how to do that; you must append ;C:\MinGW\bin to the end of the path before continuing.
Install Python from https://www.python.org/ftp/python/2.7.11/python-2.7.11.msi. Run the executable. Choose to install the feature Add python.exe to Path (it's the last option in the installer, off by default - switch it on) on local hard drive during installation; Python should then be installed in C:\Python27 (EXTRA NOTE: the most recent 2.7 installation linked here seems to install pip automatically, which is very useful for step 4)
Check that Python runs. Open a new command prompt as administrator by typing cmd.exe into the Start menu and pressing Ctrl+Shift+Enter. Type python and you should see something like:
Python 2.7.11 (default....
....
>>>
Exit the Python console with exit() or by pressing Ctrl+C. Now, make sure your version of pip is up to date: run the command: python -m pip install --upgrade pip.
Go to the directory C:\Python27\Lib\distutils and add a new file, called distutils.cfg. Inside it, put:
[build]
compiler=mingw32
Close and save the file.
Next, you need to install the dll for libnacl. First go to https://download.libsodium.org/libsodium/releases/ and choose the file libsodium-1.0.4-msvc.zip to download. Unzip anywhere, and then copy the file libsodium.dll from the directory \Win32\Release\v120\dynamic (do not use v140), and paste it into root joinmarket directory (the same directory where README.md lives). Then you need to address the Visual C++ 2013 runtime dependency. Do so by going to www.microsoft.com/en-us/download/details.aspx?id=40784 and clicking Download. Choose x86 even on a 64-bit system, and run the executable.
Note that after doing this, you must run pip install -r requirements-windows.txt from the Joinmarket root directory (where the README.md file is) and should not get an error message (this will install/check the python packages libnacl and secp256k1(-transient)).

Resources