modulenotfounderror no module named 'visual'? - vpython

I am trying to convert a py file from VPython 2.7 Program to exe file (in windows) but I am getting an error that says.
ModulNotFoundError: No module named 'visual'
Can you guys please guide me on how can I resolve this issue?
I want my Python visual file to be able to receive input and give 3D output when it' converted to EXE mode.
For example; I want to create an exe file from this codes that are in py to create my 3D output as an exe file.
from visual import*
from time import*
from math import*
L1=0.1
H1=2.8
W1=4.0
W1=0.1
W2=0.0
T1=.15
L1 = 6
a1=-H1/2
b1=H1/2
c1=L1/2
d1=-L1/2
e1=W1/2
floor=box(pos=vector(0,a1,0),color=color.white,length=L1,height=T1,width=W1+T1)
right=box(pos=vector(c1,0,0),color=color.orange,length=T1,height=H1,width=W1)
left=box(pos=vector(d1,0,0),color=color.white,length=T1,height=H1,width=W1)
behind=box(pos=vector(0,0,e1),color=color.white,length=L1+T1,height=H1,width=T1)
front=box(pos=vector(0,0,f1),color=color.white,length=L1+T1,height=H1,width=T1)

Related

Using a python library (Biopython) from a python program on a different folder that is installed

I generally like to make my python programs in a text editor and then run them after they are complete instead of line arguments. Thus, I save those .py files on a convenient folder location instead of Python program files.
I then run my .py file using Command Prompt. However it has not worked for the Biopython library as import Bio gives back a Traceback No module named 'Bio'. However, using line arguments directly on python shows it is installed.
I have never had this issue with Python in general and other downloaded libraries (import numpy for example works fine). How do I make the files available to be open from any location?? Or how do I provide the path in import?
To clarify and add:
1) I use Python from Windows 10
2) I downloaded and installed Python(3.7) from python.com
3) I downloaded Biopython using pip (and all other libraries I downloaded)
4) I also tried it on Jupyter notebook and also does not work to import Bio, whereas Import numpy does.
Thanks!

FatalError failed to execute script. PyQt5

I know that questions have already been raised on this topic, but I believe that all decisions were strictly individual. The essence of the problem:
There is a calculator.py script and a kalkulator.py These files are in the same directory, the calculator file is executable, this is the file that I convert into an EXE using PyInstaller. Inside the file, I import several PyQt5 libraries, and the second file is Python: from kalkulator import *
The second file kalkulator.py contains the GUI of the program created with QtDesigner
When i run the command pyinstaller --onefile --debug calculator.py everything goes fine.
But when I run the EXE program file in debug mode, I see the following error:
The photo shows that the following error occurs.
"DLL Load Failed: The specified procedure could not be found."
I can assume that the problem is that when assembling, PyInstaller does not see the file kalkulator.py it contains a graphical interface.
What can you say about this problem, how do you think you can solve it?
I use:
Python 3.5
PyQt5
PyInstaller 3.3.1
I managed to solve my problem! I changed the version of Python 3.5.0 to 3.6.0, and also reinstalled PyQt5.

Python GUI Tkinter is not including all libraries or modules to use

I am using Pycharm version: Pycharm Community Edition 2017.1 on Windows 7 64 bit edition, and my environment variables are set as below:
PYTHONPATH: C:\Users\vinsow\AppData\Local\Programs\Python\Python36-32\Lib;C:\Users\vinsow\AppData\Local\Programs\Python\Python36-32\DLLs;C:\Users\vinsow\AppData\Local\Programs\Python\Python36-32\tcl\tk8.6;
PATH: C:\Users\vinsow\AppData\Local\Programs\Python\Python36-32\Scripts\;C:\Users\vinsow\AppData\Local\Programs\Python\Python36-32\;C:\Tcl\bin;C:\Program Files\Java\jdk1.8.0_60\bin;%PATH%
CLASSPATH: C:\Program Files\Java\jdk1.8.0_60\bin;C:\Program Files\Java\jre1.8.0_60\bin;.
When I open a new python file using pycharm and type in:
import tkinter this works
Whereas :
tkinter.[functions popup] would display very few options:
as in image, Looks like I have to update the path variable or either some things to change in my Pycharm IDE. I am a newbie for a tkinter GUI programming.
You have a file named tkinter.py, so it's importing that file rather than the tkinter module. rename tkinter.py to something else.
Childish Mistake.
Your file is named tkinter.py which if you know is the same as the Module tkinter when you type import tkinter.
So What you are doing is;
while 3>2:
os.starfile('/pathtoyourfile')
it is an Infinite Loop going on.
When I was learning python and learning to send emails i named my file email.py and because of that my file was failing try to name you files as adrgdt.py something Unique so you dont run into this error again
I hope this helps.

Cannot find module _frozen_importlib_external when running a frozen exe program

Hi I am pretty new to cx_Freeze, so when I try to freeze a Python file (it's just a basic hello world program) cx_Freeze creates an exe along with a bunch of other things. When I run the exe it gives me a "cannot find module _frozen_importlib_external" error. I am using Python 3.5 and running Windows 10. Any help is greatly appreciated. Thanks.
I had the same problem.
The issue here is that cx_freeze can't see the import and will not embed the package _frozen_importlib_external.
Change the file cx_Freeze/finder.py with the diff given at https://bitbucket.org/anthony_tuininga/cx_freeze/pull-requests/83/python-35-compatibility-for-cx_freeze-4x/diff and then build and install cx_Freeze again.

Using py2exe by just running the script, no command-line

I know there's already a question like this but the answer didn't work for me.
When I append the py2exe argument in the program, and run it, I noticed it's missing a bunch of files. Also when I run the exe, it says
File "boot_common.py", line 46 in <module>
ImportError: No module named 'ctypes'
Can anyone help me on how to fix this? Here's my code:
from distutils.core import setup
import py2exe, sys
import tkinter as tk
from tkinter import filedialog
input('Press Enter to continue and select your Python file you want to convert when the dialog shows up...')
tk.Tk().withdraw()
file_path = tk.filedialog.askopenfilename()
sys.argv.append("py2exe")
setup(console=[file_path])
Also if it helps, I'm using a 32-bit Python interpreter.

Resources