Modules missing from installed package - python

I have installed and am trying to use fbconsole: https://github.com/facebook/fbconsole/
Looking at the instructions, I can make the first couple of steps work:
import fbconsole
fbconsole.AUTH_SCOPE = ['publish_stream', 'publish_checkins']
fbconsole.authenticate()
But when I try
fbconsole.logout()
I get
AttributeError: 'module' object has no attribute 'logout'
Looking at the file that's being installed, I do see both the authenticate() and the logout() module. Is the package not being installed correctly?

It's work correct for me!
Reinstall fbconsole with this command:
python setup.py install
I hope it's work for you too!
Good Luck

Is there same name with fbconsole.py or python package fbconsole in your python path?
If so then:
import fbconsole
print fbconsole.__file__
print dir(fbconsole) # look if the logout in the fcconsole module
then watch the file of the fbconsole module you import is what,
If not , you can atempte to remove the fbconsole.pyc in your python path(just use the same above code) and looks is it works.

Related

Unable to import light-curve in sunpy

I am trying to import 'lightcurve' in sunpy. But unfortunately got an error
cannot import name 'lightcurve'
How can I resolve this issue?
first make sure the module is installed, open the command line (search cmd in start menu) then type
pip install lightcurve
Or if your on Linux open the terminal and type
sudo apt-get install python
then import the module like this into your code
import lightcurve
sunpy removed the lightcurve submodule and it was replaced with "timeseries".
An example of this is here: https://docs.sunpy.org/en/stable/generated/gallery/time_series/goes_hek_m25.html#sphx-glr-generated-gallery-time-series-goes-hek-m25-py
I would suggest that if you found a example or resource that uses lightcurve that is very old, that it is out of date and is fit for use.
The latest documentation is https://docs.sunpy.org/en/stable/

How to know the package or module name from import statement in Python?

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.

Package for dash_table_component

I tried to run "from dash_table_component import Table" and it said it had no module named dash_table_component. I tried to pip install dash-table-experiments but it still showed no module for dash_table_component. I would like to ask that what Python package I should install to get this module?
Thank you!
from dash_table_experiments import DataTable

how to import the new installed module whie an old same module exists

everybody!
the built-in pycurl module doesn't define Curl object
conn = pycurl.Curl()
Error message:
"pycurl" module has no attribute Curl
so I download the latest pycurl and install it,but it only works when I ran the code in interactive python interpreter,and I got the same error when I ran it as a script file.
It seems that when I run it as a script file,the old pycurl module will be included.
How can I import the new pycurl module or remove the old pycurl module?Thanks in advance.
PS.
in pydoc,the pycurl(old) module under '.' is clickable,redirecting to a page only saying "module has no attribute Curl",while the one(new) under '/usr/local/lib/python2.7/dist-packages' is gray and unclickable
It's a matter of when it is found. The basic import handler used in Python looks at the paths specified in sys.path in order to find a module, and after it has found something matching pycurl it will use it and not look further.
So, you need to either put your own copy of pycurl higher in the module search path, or in your own script do something like sys.path.insert(1, '/path/to/my-pycurl') with the path to the directory containing the pycurl package.

Python: installing multiprocessing

I need to import the multiprocessing module in Python 2.5.
I've followed the instructions here exactly: http://code.google.com/p/python-multiprocessing/wiki/Install
make and make test run without errors. I've also edited $PYTHONPATH to include the directory where the package is installed.
But 'import multiprocessing' still says: "ImportError: no module named multiprocessing".
What am I doing wrong? Is there some step missing from these instructions? I haven't installed a Python module before.
Navigate to the directory containing the package then type:
python setup.py install
This info was contained in the INSTALL.txt file.
http://code.google.com/p/python-multiprocessing/source/browse/trunk/INSTALL.txt
perhaps you can try:
import sys
sys.path.append('/path/to/processingdotpylibs/')
import processing

Categories

Resources