Cannot get started with Vpython - python-2.7

I am a new to python. I am have installed Python27 and Vpython on my windows 64-bit W8.1 laptop.
The python version was Py27 32-bits and Vpython 32-bits. After installation I thought I could directly run an example program from the VIDLE (File -> Open -> bounce). But I realized there is lot more to install to get this working.
So I googled the errors and found that I has to install Numpy and WxPython which I was able to complete successfully. But now I have this error shown below
"The Polygon module is not installed,
so the text and extrusion objects are unavailable.
The ttfquery and/or FontTools modules are not installed,
so the text object is unavailable."
I googled for this but was not able to arrive at anything.
Should I install Polygon module, FontTools and ttfquery module?
I was not able to fond a proper link to do any of the above. Kindly help me out. I have a hit a wall.
Thanks!!

Hopefully was able to solve the issue.
The problem was with the way how I installed Vpython. I should have accidentally selected "custom installation" instead of "full installation".
Also the version of numpy that comes with default set-up did not support for me. Hence I used the pip to update the version and now everything is up and running.
I am able to get the example programs to work.
Also the 64-bit version is not working still. So its always safe to stick on to 32-bit version even if your machine is 64-bit

You're working with an older version of VPython that is no longer supported. See the first page of vpython.org.

Related

How to find the correct version of PyBindGen for Python Bindings

Currently, I am working on the Ns3 simulator and now trying to enable the pyviz visualizer. According to the doc, I have downloaded the three dependencies which are
py27-pygtk
py27-pygoocanvas
py27-pygraphviz
Now in order to use this, I still need to enable the python bindings which I used /usr/bin/python2.7 ./waf configure wanna to check what needs for enabling python bindings. The result shows that
Python Bindings : not enabled (PyBindGen version not correct and newer version could not be retrieved)
So I checked the Doc and downloaded PyBindGen (version 0.18.0). The output shows
Installed /Library/Python/2.7/site-packages/PyBindGen-0.18.0-py2.7.egg
Processing dependencies for PyBindGen==0.18.0
Finished processing dependencies for PyBindGen==0.18.0
After I ran the configuration check the results still showed that PyBindGen version not correct and newer version could not be retrieved
So I presume that is that because I installed the wrong version of PyBindGen? If so how can I get the suitable version for enabling Python Binding?
I would appreciate if there is someone who can help me figure it out. Many thanks.
S.
According to the Google Group
Here is the resolution(tested it worked):
follow the instruction
hg clone http://code.nsnam.org/ns-3-allinone
cd ns-3-allinone && ./download.py
This will solve the Python Binding problem
Updated: after downloading this version of ns3. Solving the python binding problem. Then there will be another problem after running
./waf configure
it will show the result like this:
PyViz visualizer: not enabled (Missing python modules: gtk, goocanvas, pygraphviz)
Even though I have installed all of the three dependencies. So after some researches I found that there has another questions post So there is a guy gave the guessing that
" Waf found the standard Python here (/usr/bin/python is the Apple path), and you installed the python libraries using MacPorts.
Most probably you'll need to configure Python to point to the MacPort-based Python, or it will not see what you installed."
So according to How to: Macports select python
here is the solution:
port select --list python
sudo port select --set python python27
Hope it will help anyone come afterwards to use this.
S.

pyinstaller 3.2 build pyqt4/python2.7 to onefile exe, can not run missing msvcr100.dll?

As title,
Build successful, but the exe can't run. can not found msvcr100.dll.
I can put msvcr100.dll with exe in the same dir, the exe can run.
But I just want only one exe file.
Anyone know how to do?
Has solved. This is a bug of pyinstaller3.2, the new in the git has solved this bug. Down the newest source in the github, erverything works fine.
Has solved. This is a bug of pyinstaller3.2, the new one in the git has solved this bug. Down the newest source in the GitHub, everything works fine.
This is correct, I cant tell you how much that answer helped me out. I have been trying to build a single exe Exploit to execute on Windows XP with-out it crashing for my OSCP Labs/Exam. I followed so many tutorials and nothing seems to work. I was able to build the EXE but could not get it to run under a single EXE.
If anyone who reads this is getting "This Program cannot be run in DOS mode" try running it from another machine with the same build (Windows XP). There is not much info out there on how to solve that from a Reverse Shell on a End Of Life Operating System using an EXE exploit built with Pyinstaller. (Lots of Trial and Error and determination)
Microsoft Visual C++ 2008 Redistributable Package (or some other version depending on python version) is needed in any case, python27.dll requires it
I was also receiving an error about msvcr100.dll when ran from the GUI on my build machine(WinXP SP2). This is corrected in the 3.3 Dev version on GitHub.
I installed the C++ 2008 Package but this didn't solve my problem when I re-built the EXE, the 3.3 Dev Pyinstaller was the solution.
What I did was:
Zip down the Dev version of Pyinstaller 3.3 Dev(GitHub) is the newest for 11/14/16 that I could tell. Make sure you have Python 2.7.x (I used 2.7.11) and pywin32 installed that matches (Python 2.7.x) version. (And it does matter if its 64-bit or 32-bit) Use the setup.py to install Pyinstaller, make sure you do not have a previous version already installed, if so use pip or etc. to remove. I installed with pip first and this was my whole issue.
I was able to get all of my 32-bit Single EXE Exploits to run on 64-bit/32-bit Windows machines up to Windows 10.
Once that is completed, make sure Pyinstaller is in your $PATH and follow the standard tutorials on creating a --onefile EXE. Copy to your Windows Target machine and it should work with-out error. I did not need to pull any dependencies over but you may have to include some with the --hidden command. Its greatly detailed in the Pyinstaller documentation on how to include hidden .dlls
If this still doesn't work for you try using py2exe. Its a little more complicated but it your determined you will figure it out.
If you have code written in python 2.x.x and 3.x.x you can have multiple environments of Python and have Pyinstaller installed in each. This is in the documentation as well.
Thank you jim ying. Your 2 sentence answer was exactly what I needed.

How to install Qt 3.3.8 in Ubuntu 14.04

Just recently I have begun to review the code for a project produced by a friend roughly 4 years ago. However, to compile this project I need an outdated version of Qt (version 3.3.8). Much of the code used in this project isn't supported in the same style as Qt4. So I'd first like to obtain Qt3 before I transition to Qt4.
Ubuntu has decided to no longer carry "qt3-dev-tools". Ubuntu has limited the selection to "qt4-dev-tools" in its repository. So installing via the command line option (sudo apt-get install qt3-dev-tools) results in an error:
"Unable to locate package qt3-dev-tools."
So, from here I did some digging for a manual installation? I found a great website to help me through the process, but I'm not very knowledgeable about Ubuntu, or Linux in general. Step 1 was simple. But step 2 and onward stumped me. I'm supposed to be both adding the environment variables listed in step two to the .profile file and then setting them, correct?
In step 2, is logging in again just meant for users with the .login shell? When I type in $HOME/.qt-license of step three, I suppose I'm typing this into the terminal?. Same with the ./configure? Both of these commands return no such file exists.
Does anyone know a better walk through to install Qt3 files, or can give a quick breakdown of this tutorial?
The website tutorial:
http://krm.am.gdynia.pl/doc/qt-3.3.8/INSTALL
If u can get .rpm package then open it in ubuntu software centre . It will get installed.
http://download.qt.io/archive/qt/3/ try downloading the package for qt3 from this qt archive & install it.

Having trouble getting Python to recognize location of vcvarsall.bat

I was trying to install RandomWords which requires ujson, at some point in the installation I received the following notification: "error: Unable to find vcvarsall.bat" I searched here, on stackoverflow, and came across some answers as the to root of this problem. In this answer https://stackoverflow.com/a/8705722, near the end, the OP pointed out that Microsoft had released a C++ compiler package for Python 2.7 (http://www.microsoft.com/en-us/download/details.aspx?id=44266).
I installed this package but still haven't had any success in installing ujson. So far I've tried the following:
Adding the location of vcvarsall.bat to the path environment variable
Manually tried loading the VC++ compiler's environment into the session by executing vcvars64.bat (aI've tried vcvars32.bat as well) as recommended here: https://stackoverflow.com/a/18045219
I've also tried installing the compilers found in "Windows SDK for Windows 7 and .NET Framework 3.5 SP1" found here: http://www.microsoft.com/en-us/download/details.aspx?id=3138
Not sure where to go from here, any suggestions/help would be greatly appreciated.
For reference here's some relevant specs:
Windows 8.1 (64-bit)
Python 2.7 (64-bit)
I've been trying to install said package using pip from the command prompt (e.g. '> pip install ujson')
I've uninstalled all the C++ compiler packages I've tried except this one: http://www.microsoft.com/en-us/download/details.aspx?id=44266
Really don't feel like installing mingw, but I'll try it if it seems like it's the only solution.
-UPDATE-
I ended up modifying "msvc9compiler.py" and manually setting the location of vcvarsall.bat by setting the value of the vcvarsall variable to the location of that batch file. Everything compiled fine but this is not a recommended solution. I'm pretty sure the compiler version I have matches the one python 2.7 uses, but as mentioned in an answer, in another question on this topic, if these don't match it can cause problems since "the compilers will probably have incompatible C runtime libraries."

Installing PostgreSQL and pyscopg2 on Snow Leopard

I'm still a complete beginner in the field of web development and I'm trying to set up the Django environment. I'm reading "the definitive guide to django" to start my practice.
I'm running Snow Leopard (10.6.2) on a macbook 2.1GHz. It came with Python 2.6.1. Since Snow Leopard cam with Python 2.6.1 preinstalled, so I didn't do any extra set up. Maybe it needs more setup, please let me know. But I've ran it, and it works.
I installed django straight right from the book. I've ran it, and so far it works.
The Database configuration is the one stifling me.
I tried installing MySQL with MySQLdb module for python, but it had complications with the difference between 32 & 64 bit architecture (either mysql had 64 and python had 32 OR vice versa; Either way, I couldn't figure it out). I've read many forums and tinkered with it for hours, still couldn't fix it and I just gave up.
So I tried the next best thing (or so I thought), Let's try to set up Postgre instead. So, I went to the official Postgre website and picked the Mac OS X installment package. I download it, extract it, and all it had was an ".app" installer and a "README". I ran the installer, blah blah blah, I followed the instruction, it did this, it did that. At the end, apparently Postgre is installed.
I didn't feel completely sure if it was installed, so I searched around the internet for some answers. Well, I found the official documentation for installing Django for Mac, but the steps to install
Postgre was completely different. Maybe the ".app" installer did most of the configuration listed in those steps, I don't know.
Then I went to the terminal and type in:
psql -V
(to check which version of Postgre I just installed)
AND
sudo -u postgres pg_ctl start
(to run the database)
'psql' or 'pg_ctl' commands could not be found. To me, this is kind of saying Postgre was not installed or there are some setup I still need to do.
So I started looking at the first steps of installing Postgre from the given instruction by Django (link above). From the instruction it says to edit the '~/.profile', even after unhiding all the files and directories, I still can't find it under my user directory.
At this point I'm just kind of frustrated and don't know where to go. I was wondering if I can get some direction/tips/howto/anythingreallyatthispoint.
I can't really install psycopg2 until I have Postgre running, but from the looks of it, it doesn't look so bad to install it (or so I hope).
Many Many thanks in advance for any help ^_^
-Tri
If you're just getting started, I would try sqlite first. It's file based, so there is almost no configuration. Later, if you want to upgrade to a real database, then it won't be any harder than what you're attempting now.
the easiest way to install these apps would be via macports (http://www.macports.org/). in my experience, the installation was fast and clean. the geodjango installation documentation has a good section on this: http://geodjango.org/docs/install.html#macports.
I suspect the only problem you are having is not setting path. Add this to your ~/.bash_profile:
export PATH=/Library/PostgreSQL/8.4/bin:$PATH
Now you should be able to run the command line tools like psql.
I just spent a couple hours going through multiple different walkthroughs. This was the one that eventually worked:
first install postgress with the dmg:
http://www.enterprisedb.com/products-services-training/pgdownload#osx
then follow this tutorial:
http://stubblog.wordpress.com/2009/06/07/installing-psycopg2-on-osx/
then put this in terminal export DYLD_LIBRARY_PATH=/Library/PostgreSQL/9.3/lib:$DYLD_LIBRARY_PATH
And I'm pretty sure those were the important parts of what I did..
if you get errors try sudo pip uninstall psycopg2 then sudo pip install psycopg2
if you keep getting errors about ".... something < 10.4", reinstall pip. I think I used something like brew install python to update python... if you don't have homebrew, get it. I'm pretty sure that's what got rid of that error.. it may have been a manual install of pip3 though.
Sorry this is all over the place, it should get you a bit closer though. At least, if you (like me) have had none of the other tutorials work.