trying to use python3 and this library and im receiving this error ImportError: cannot import name 'format_exc'
tried uninstalling python3 and reinstalling, im also on Ubuntu 18
need it to run my code, the code works but python3 does not
Check your filenames, for example, if you have a token.py file in your project, rename it. Its just a conflict with the filename and some libs as Alex Jadczak and Sara pointed out.
Related
I installed tabula-py using pip install, and importing it gave no errors.
I also made sure JAVA was added to PATH (environment variable).
However, when I try to run:
from tabula import read_pdf
I get the error:
ImportError: cannot import name 'read_pdf' from 'tabula' (unknown location)
Any ideas on how to proceed from here?
I am using Pycharm if that helps.
First you need to give a file name to java/python argument.
You can locate your file by commanding
find . -name
and type cd and drag your file where your Pycharm project is at
so that it automatically gives you the file name after cd. like
ex)) cd /User/wasabi/PycharmProjects/pythonsample2/
and after you command terminal to start using your JAVA/Python/ whatever, you can do
from tabula import read_pdf
I'm not an expert, but I solved the issue like yours in this way.
You don't need the parentheses on the import command
from tabula import read_pdf
I have a python file and the developer of that code has left the organization. When I run the code I get the following error.
import dataAnalysis as DV ModuleNotFoundError: No module named
'dataAnalysis'
I provide below the brief snippet of the python file "main.py" below.
import dataAnalysis as DV
def performCheck():
... other code
... other code
i = DV.addGraph( pathplus)
Here my question is , how to know the actual module or package name of "dataAnalysis" from the above import statement so that I can make "pip install ". However, I tried to install DataAnalysis module, still it does not work.
Is there any way to get the module or package name to install from the import statement in python ?
Go to console or terminal and run command pip install dataAnalysis. If permission denied, then make sure you have enough privilege to install a package.
Update:
In my opinion pip package DataAnalysis is a library that can be used for pre-processing a csv file. As per your given code, it looks like adding a graph so may be it could be a local package. Check dataAnalysis folder in your project with __init__.py file inside.
I’m new to Python and programming in general.
I am trying to install pdfMiner. I have Windows 7 with Python 2.7 installed.
I followed the instructions when installing (downloaded the PDFMiner source, unpacked it, and ran setup.py to install and it was installed in C:\pdfminer) – no errors.
It created:
build, build\lib,build\lib\pdfminer, then copied files to build\lib\pdfminer. It created build\scripts-2.7 and copied tools\pdf2txt.py, dymppdf.py to scripts, then wrote install-egg-info
and had no errors with install.
When I try running the test document from the command line:
C:\pdfminer\pdfminer-20140328> pdf2txt.py samples/simple1.pdf
I get:
File “C:\Python27\Scripts\pdf2txt.py”, line3, in <module> from pdfminer.pdfdocument import PDFDocument
ImportError: No module named pdfminer.pdfdocument
I saw this post:
pdfminer - ImportError: No module named pdfminer.pdfdocument
and tried following it (#1..put sys.path.append… into pdf2txt.py) and get the same error.
The system variables do include the path (pdfminer\pdfminer-20140328).
I’ve looked for other solutions but haven’t had much luck – the file is there but I can’t seem to get the program to look in the right area for it…I think.
Do I have the wrong path or is it installed in the wrong directory?
I tried to install VIM-Latex using the Pathogen plugin on my machine which is running OSX Lion 10.7.5. I copied the downloaded VIM-Latex plugin files into my ~/.vim/bundle directory.
I also edited the .vimrc according to the instructions specified here.
However, I'm getting the following errors on trying to open a tex document in MAC Vim:
File "/Users/username/.vim/bundle/vim-latex-1.8.23-20130116.788-git2ef9956/ftplugin/latex- suite/outline.py", line 12, in <module>
import StringIO
ImportError: No module named StringIO
Error detected while processing /Users/username/.vim/bundle/vim-latex-1.8.23-20130116.788-git2ef9956/ftplugin/latex-suite/main.vim:
and
File "/Users/username/.vim/bundle/vim-latex-1.8.23-20130116.788-git2ef9956/ftplugin/latex-suite/pytools.py", line 1, in <module>
import string, vim, re, os, glob
ImportError: No module named string
Also, I ran a basic python script from the terminal that imported StringIO and string, and both seem to be getting imported just fine.
I'm not sure where the problem is here. Since I'm really new both with VIM and Installing Plugins, I'm not sure how I should go about debugging this issue, and so, any help will be precious!
Thanks!
StringIO and string are not available in Python 3.x. To make this code work, you have to run it with Python 2.x, e.g. Python 2.7.
I followed step with nlopt
and get a _nlopt.pyd
When i try to use nlopt.py(it's have code like follow)
import _nlopt
and it's gives
ImportError: No module named _nlopt
I am sure the _nlopt.pyd is in the folder
And it's work in Windows7
Any help?
Make sure you first configured with the --enable-shared flag before compiling