XBRL Module Not Recognized - python

I've downloaded the XBRL module using pip install. But the Python interpreter says "No module named 'xbrl'", despite the XBRL being present via C:\Program Files\Python36\Lib\site-packages. How do I resolve this issue so I can run XBRL in Python?

I think you need to install python-xbrl.
Th easiest way is with pip :
pip install python-xbrl

Do you have two Pythons? It could be you installed the module with one pip/python and tried to import with another python.
Anyway there is nothing to use: the module xbrl.py doesn't have any content. This xbrl.py is unusable, you should look for a different implementation.

Related

Module importing works in python console (pycharm) but not works on terminal

Hi i'm recently working on a module in python (package named pykiwoom)
I installed a module in conda 32-bit environment pip install pykiwoom and tried to import this
from pykiwoom.kiwoom import Kiwoom
This works perfectly fine when I execute this in python console in pycharm
However, when I try this in terminal error occurs
ModuleNotFoundError: No module named 'pykiwoom.kiwoom'; 'pykiwoom' is not a package
internal structure of package pykiwoom looks like this
pykiwoom
init.py
kiwoom.py
parser.py
Can somebody tell me why this error occurs?
I think where you install your package is important in your case. You can check the packages installed using pip list in terminal, and check if you find it there.
This solution provides overview of how to setup your files as packages and modules.
Nevertheless, I think if you install your package in the terminal using pip, you could possibly access it.

Trying to import GitHub module

I'm trying to import https://github.com/chrisconlan/algorithmic-trading-with-python in my code. I've never imported anything from GitHub before and have looked at various other questions that have been asked on Stack Overflow regarding this problem but it just doesn't work. When I try to run the 'portfolio.py' code for example I keep getting a ModuleNotFound error for 'pypm'. What exactly is the correct way to import such a module or the whole GitHub directory?
I'm working with Visual Studio Code on Windows.
You will need to pip install the module. In your case the command you would need to run is python -m pip install -U git+https://github.com/chrisconlan/algorithmic-trading-with-python. Once you have done that you need to find the name of the module. You can do this with pip list. Find the name of the module you just installed.
Then you just stick import <module name> at the top of your code with the rest of your imports.
What i used to do in this is to clone the repository on the folder where are installed the python's packages. This is useful when you do not want to use the pip cmd tool, keeping the pip's cache memory under control.

How to install SUMOLIB using Python3?

I am working on a project which has SUMOLIB module as a dependency on , but I have no idea how to install it. I tried doing pip install sumolib, but it shows me that no such module exists.
Can someone tell me how to install SUMOLIB?
Maybe look at the downloads page of Sumolib.
https://sumo.dlr.de/docs/Downloads.html
sumolib is installed as a part of the SUMO package. It can be found under SUMO_HOME/tools/sumolib.
To use sumolib in a script, check here.

Downloaded package ImportError

I have recently installed python 2.17.14 to use a package which I installed in the command prompt with:
python -m pip install packageName
However, whenever I try to use it with a script provided by the package authors, I get Import Errors:
ImportError: cannot import X from YX
ImportError: attempted relative import with no known parent package.
I don't know what I'm doing wrong, as I am really new to Python. Does anyone have any ideas?
The package is called neurodesign and I downloaded the try out script from the official website "neuropowertools.org"
Best,
Max
In case anyone (who is also new to python^^) fails ridiculously at this task as well: I had to manually install all the modules used within this package for it to work as they weren't installed automatically.

How do I install modules on qpython3 (Android port of python)

I found this great module on within and downloaded it as a zip file. Once I extracted the zip file, i put the two modules inside the file(setup and the main one) on the module folder including an extra read me file I needed to run. I tried installing the setup file but I couldn't install it because the console couldn't find it. So I did some research and I tried using pip to install it as well, but that didn't work. So I was wondering if any of you could give me the steps to install it manually and with pip (keep in mind that the setup.py file needs to be installed in order for the main module to work).
Thanks!
The cleanest and simplest way I have found is to use pip from within QPython console as in This Answer
import pip
pip.main(['install', 'networkx'])
Step1: Install QPython.
Step2: Install AIPY for QPython.
Step3: Then go to QPython-->QPYPI-->AIPY and install from there Numpy, SciPy, Matplotlib, openCV etc.
Extract the zip file to the site-packages folder.
Find the qpyplus folder in that Lib/python3.2/site-packages extract here that's it.Now you can directly use your module from REPL terminal by importing it.

Categories