Box2D Python using Visual Studio - python-3.x

I am new to Box2D, first of all I want to apologize for maybe trivial question.
I have understood that it is written in C++ but it can be used with various different languages. I need to use it with Python, ideally with MS Visual Studio 2017 (but Idle or Canopy will do).
I was able to build Box2D to Visual Studio but I do not know how to run it using Python, could you please help me (a step-by-step solution would be really appreciated).
Thank you very much

You can use PyBox2D which is a binding to original library.
There are prebuilt package but it is a conda package you can install it with 3 steps:
Install miniconda3. Download it from here
Create a new environment (named py34 here) and activate it:
$ conda create -n py34 python=3.4
$ source activate py34
Install Box2D from the repo author:
$ conda install -c https://conda.anaconda.org/kne pybox2d
If you want to build from source (library author only suggests if you want to latest features or if you want to help development) here is the guide
Disclaimer: These steps are taken from the github repo itself

Related

Install packages such as Wordcloud for Python: what tools to be installed?

when trying to install packages such as wordcloud, I get the error message
error: Microsoft Visual C++ 14.0 is required. Get it with "Build Tools for Visual Studio": https://visualstudio.microsoft.com/downloads/. When following the link, the installer proposes many different options. Just selecting the C++ requires almost 7GB.
Could you help me choose the bare minimum options required to install wordcloud? Indeed I have a small config, and would rather avoid using so much space for a small package (and for the moment, I don't plan using Visual Studio except for that matter). Thanks!
Have you followed the information in the instruction for setup with Python found here?
It indicates that you should update setuptools pip install --upgrade setuptools before doing anything else.

Is it compulsory to download Visual Studio for spacy?

I have tried installing spacy, but it is throwing the below error:
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft
Visual C++ Build Tools":
http://landinghub.visualstudio.com/visual-cpp-build-tools
I don't want to install Visual Studio. Is there other way to resolve this?
At the moment, installing spaCy requires a compiler. On Windows, this is included in the Visual C++ Build Tools. (Not to be confused with Visual Studio – you definitely don't need the whole thing.)
If you install spaCy from conda, you should be able to install binary wheels, which don't require a compiler:
conda install -c conda-forge spacy
Providing binary wheels for pip is definitely on the spaCy roadmap – you can follow the discussion and work in progress in this thread.
I stumbled upon the same thing but however managed to do it without MS Build Tools. However the process requires a bit of manual effort, but that's worthy if you don't want to waste space for MS Build Tools.
Visit Unofficial Windows Binaries for Python Extension Packages. Here you can get many binary wheels of a number of python packages for various python versions and both for 32/64 architectures.
Next search and download ujson, cymem, murmurhash, preshed, cytoolz, thinc and finally spaCy.
Install each wheel in the downloaded order using pip install some-package.whl
Hopefully spaCy will be installed successfully. If not, please leave a comment and I'll try my best to help you out.

Downloading and installing PyBluez for a 64-bit Windows 10 PC?

I'm trying to use bluetooth with python, and I came across a module - pybluez. Right then, I tried installing it by running pip install pybluez. The package was located and downloaded, but it raised an error when running python setup.py egg_info.
I then tried to download pyBluez from this link https://pypi.python.org/pypi/PyBluez
But, it said that the Python version installed on my PC is not 2.7 ( I have 2.7.10; do I need 2.7.0 for this?) Also, this download link is for a 32-bit system, and that might be the reason it does not run on mine.
So I ask:
1. How do I fix this error?
Error in the output when I try to install pybluez using pip:
2.Does download using https://pypi.python.org/pypi/PyBluez need python 2.7.0, and a 32-bit system? If so, can someone suggest a better way for a 64-bit system?
3.Any other bluetooth module that could work as a substitute?
I have successfully built pybluez for win10x64 with python3.6
Download and install windows 10 build tools: https://www.visualstudio.com/pl/thank-you-downloading-visual-studio/?sku=BuildTools&rel=15
Run 'Developer Command Prompt for VS' as administrator
Clone pybluez repo https://github.com/karulis/pybluez
cd to directory with repo
run python setup.py install
Happy bluetoothing
This is an "expanded solution" which supplements the other answers posted.
Bluetooth is readily supported on Linux in basically any context. Python 3 built-in socket objects work over bluetooth even. But for Windows, there are hoops to jump through. The standard solution for this is to use PyBluez. If you're really lucky, you might be able to install with just pip install PyBluez-win10. If that fails, however, the way to go is an installation via a pre-compiled "wheel".
A given wheel only works for your specific context, however, i.e. exact Python version. So, for the sake of future proofing, if you are going to need PyBluez, you should know how create a wheel from the source for yourself. It's a long, annoying process if you don't have the all the software required already and are not familiar with some parts of the process e.g. using Anaconda. So, if you are working in a team, I suggest having one person burn their time on this and then share the wheel with everyone (who are hopefully on the same version of Python!).
The following is a paraphrased version of what is posted here: https://github.com/pybluez/pybluez/issues/180 which includes the actual developer's comments and methodology.
Download and run the "Visual Studio Build Tools" installer:
For an official list of exact compilers and links to match against target Python versions, refer to: https://wiki.python.org/moin/WindowsCompilers
Here's the 2019 Build Tools link, which works with Py3.7:
https://visualstudio.microsoft.com/downloads/#build-tools-for-visual-studio-2019
During the install you MUST select BOTH "Visual C++ build tools" AND "Universal Windows Platform build tools". Leave the default options alone within those (e.g. including the Windows 10 SDK).
Note: this requires 15GB of disk space, and some patience!
Install "Miniconda":
https://docs.conda.io/en/latest/miniconda.html
Select the one which matches the bit set (32 vs 64) of the destination Python version
you wish to install PyBluez into.
Clone the PyBluez source repo to a temp location (e.g. your desktop). Then, launch the terminal and change into that directory:
git clone https://github.com/pybluez/pybluez
cd pybluez
If you did NOT put conda on the system path (as the installer recommends NOT doing so), you can add it for this local CMD session per this example command:
set CONDA_DIR=%USERPROFILE%\Miniconda3
set PATH=%CONDA_DIR%\condabin;%PATH%
Create a dedicated environment to build pybluez with the desired Python version. Then, launch that. The example below uses Python 3.7 but the same steps will also work for other versions (including Py 2.x etc)
conda create -y -n pybluez python==3.7
activate pybluez
Build a wheel file. Then, leave the dedicated environment.
python setup.py install
python setup.py bdist_wheel
deactivate
Copy the wheel to your desktop. From there, you can do with it as you wish. Then, delete the pybluez conda environment and the source repo, (as you no longer need either of them).
copy .\dist\*.whl "%USERPROFILE%\Desktop"
cd..
rd /s /q "%CONDA_DIR%\envs\pybluez"
rd /s /q pybluez
Finally, you can install the wheel to a target Python instance and/or store/share it:
The name of these files and the path will vary, so define those first for your use case
set PYBLUEZ_WHEEL=%USERPROFILE%\Desktop\PyBluez-0.22-cp37-cp37m-win_amd64.whl
set PYTHON_PATH=python
Install the wheel:
%PYTHON_PATH% -m pip install "%PYBLUEZ_WHEEL%"
Confirm installation:
%PYTHON_PATH% -c "import bluetooth; print(bluetooth.__version__)"
I downloaded a Python 3.6 wheel from here (wheels for python 2.7, 3.5, 3.6, 3.7 available too).
I installed it in my virtual environment via
pip install PyBluez-0.22-cp36-cp36m-win_amd64.whl
One command solution.
pip install git+https://github.com/pybluez/pybluez.git#egg=pybluez

How to install kate5

I tried to install the latest version of kde editor kate, but nothing changed.
I took the source code: git clone git://anongit.kde.org/kate;
I followed http://kate-editor.org/get-it/'s instructions;
Now, when I run ~/kde/usr/bin/kate-v is the same version that was:
$ ~/kde/usr/bin/kate -v
Qt: 4.8.6
Plataforma de desenvolvimento KDE: 4.14.1
Kate: 3.14.1
How I do to install the lastest version?
Grateful
First of all: the version in the About dialog is built from the KDE version, so it does not all reflect whether you are running a self-compiled one or not. Second, you should run Kate with all environment variables properly set - just running the executable will probably load the wrong ktexteditor.so library.
The easiest way to get Kate5 is to install a distribution that ships Kate5 (probably along with Plasma 5).
If you already have a KDE Frameworks 5 (KF5) environment available, then you can also build Kate5 from sources by following the build instructions. These were updated in June 2015.
If you are still on KDE 4.x and you have no KDE Frameworks 5 packages installed, then you also need to build KDE Frameworks 5 from sources. In this case, you have to follow the KF5 build instructions. If you've questions, feel free to ask on kde-frameworks-devel#kde.org and/or on the Kate mailing list.

How to install VTK5 on Archlinux?

I need to run a program which use VTK5 on my Archlinux PC, but I found it really hard to install VTK5, there is only VTK6(not compatible with VTK5) in official repo, and when I try to install it from AUR, it returns "Makepg was unable to build vtk5", then I try to install through source code, the result is that I was unable to install the VTK Python module...
Is there anybody who has any experience or idea about it?
I have not installed on Archlinux specifically, but on different linux machines. If you compile from source and are interested in python, remember to select the option python wrapping when running cmake. Btw, once built, you will have to update both the pythonpath and the ldlibrarypath.
You can also have a try at enthought canopy, which distributes a complete installation with numpy, scipy, vtk http://docs.enthought.com/canopy/quick-start/install_linux.html

Resources