Getting Error while importing docx module - module

I have a simple program to read .docx files. But when I run it, the following error occurred. Can someone explain to me what the error description is?

i have resolved the issue myself. There was a file named docx.py inside the folder where i kept all of my python stuff. Actually, pythons was import that file instead of original module "docx".

Related

PyInstaller Executable File: ModuleNotFoundError - Pandas

Background: I have a .py script which uses c.10 libraries/dependencies (e.g., pandas numpy json) and the script also relies on a .ini file, which it looks for in the same dir as it is located.I want to add this .py file to Windows Scheduler, but before I can, I must make the file executable.
Issue: I used PyInstaller to create an executable file. I also added -- onefile and -w when creating the .exe file. My issue is that when I attempt to run the main.exe (either by double-clicking or through cmd) I get the following Unhandled exception in script -
Help: I am trying to understand how this is happening, especially as my understanding of PyInstaller is that it would create an executable file, which would inc. everything the script needs to run (Note: I have double checked that the .py contains import pandas etc.
Can someone explain to me how I would troubleshoot this and/or if there are any key steps I may have obviously missed, which might be causing this?
Try using this commandline for compiling your python file, pyinstaller.exe --onefile --noconsole --hidden-import pandas {Your_FILE_NAME}.py

Tensorflow(GPU) in sublime text 3

I tried to install tensorflow and finally got there.
I got an error:
ImportError: libcudnn.Version: cannot open shared object file: No such
file or directory
while I was installing but I could handle it. I think it works fine in terminal.
However, the problem is when I tried to import tensorflow in sublime text, it spits the same error.
ImportError: libcudnn.so.6: cannot open shared object file: No such
file or directory
Cause I changed the build system path to /home/username/.conda/envs/tensorflow/bin, I can't understand why I get this error here.
Is there anyone who can help me?
As it is working from terminal I think everything like cuda, cudnn and GPU drivers are setup properly and the export path is added to the .bashrc (~/.bashrc) file. That's why running from terminal works. As adding the export information to only .bashrc file will make it work on terminal but won't help for other programs like sublime.
So, I suggest, you take the export information from .bashrc file and add it to /etc/environment file. You need to log out from current user and login again so environment variables changes take place. The export information on .bashrc file should look something like this.
export PATH=/usr/local/cuda-8.0/bin${PATH:+:${PATH}}
export LD_LIBRARY_PATH=/usr/local/cuda-8.0/lib64\${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}

Cannot use TSC - Error reading file "anything.ts": File not found

No matter what I do I cannot get the TSC Typescript compiler to find any files. I have tried both the tsc that comes with the Visual Studio Extension and the one that comes from npm. I've tried in the Node.js command line windows shell, and the Git Bash shell. No matter what I do, it just says the file is not found. I've read that the compiler will only work for .ts and .str files, but that does not seem to be the problem.
Here is a quick example of what I'm seeing. I know these files will be empty, but I've tried all of this with files containing code and it doesn't change anything.
C:\>touch test.ts
C:\>ls *.ts
test.ts
C:\>tsc test.ts
Error reading file "test.ts": File not found
C:\>tsc C:\test.ts
Error reading file "C:\test.ts": File not found
C:\>touch test.str
C:\>tsc test.str
Error reading file "test.str": File not found
C:\>tsc ./test.str
Error reading file "./test.str": File not found
C:\>tsc ./test.ts
Error reading file "./test.ts": File not found
C:\>touch test.js.ts
C:\>tsc test.ts
Error reading file "test.ts": File not found
C:\>tsc test.js
Error reading file "test.js": File not found
I'm afraid, that TSC fails that way on empty files.
Looks like a bug in the current compiler [0.8], tsc shouldn't fail on empty files. However
I know these files will be empty, but I've tried all of this with files containing code and it doesn't change anything.
I'm a bit worried about this part. Is that still the case?
That's difficult to debug from afar. The typescript compiler does quite a lot of processing until it resolves a file.
What's the output of running
tsc -debug test.ts
? Also, please make sure that test.ts is non-empty.

Jython ImportError when embedding into Java on 'xml.dom.minidom'

I have a python script which is processing XML using xml.dom.minidom.
When I executed it with Jython by command line (jython myfile.py), everything was fine.
But when I tried to do the same thing embedding it into a java application, (I mean reading it as an java string then passing this string for evaluation) I got:
import xml.dom.minidom
ImportError: No module named xml
Which is driving me crazy. I tried to use different jython version (2.2, 2.5), to clear the cache, but nothing works!
Jython's Documentation tells me that we can use this module without any particular remarks.
Some people had the same problem on the internet but never got any replies. Except this:
here but still nothing work. I think I have the correct values in my jython registry, because it's working using the command line! It's just the embedding which fails everything.
I'm using a full install of Jython.
Why so much trouble, so?
Thanks in advance.
i've never done this before, but are you trying to embed jython like they did here or here? do you know where you got the jython.jar in your java classpath from? if you know where your jython module is located on disc then you might be able to just add that path as they did at the bottom of this page. To find the location of your module, load up jython and look in sys.path for a path that ends in Lib. that location should have a directory named xml (the xml package) which contains a directory named dom (the dom package), which contains a file minidom.py (the minidom module).
The xml module (jython) isn't on the the python-path of your embedded jython.
This may help:
use a jython-jar which contains the Lib (and all the Batteries :-)
put the Libs on the classpath of your java app
to help debug:
log "sys.path" in your embedded jython

Problem with Flex Builder

I have created on sample mxml application. While running the
application, getting error:
File Not found: in bin-debug folder the mxml is not compiled to html.
Suppose i have created file name: newFlexTraining.mxml.when i run this
mxml, getting error, newFlexTraining.html is not available in bin-
debug.I checked in bin-debug folder in flerx builder, the html file is
not created. Earlier it was working fine.But now i am getting this
problem. Can you any one pls explain me ASAP.
Thanks,
Ravi
Did you modify html-template?
Delete everything from bin-debug folder, clean the project and rebuild it.
in bin-debug folder the mxml is not compiled to html is this the original message? Post the original error message.