Camelot can't create new project - python

I'm trying to install and run the framework Camelot on Ubuntu 12.04. But from the error the problem seems to be sqlalchemy. I've installed camelot with:
pip install camelot and it installed without any problems. I've tried to upgrade both sqlalchemy and camelot but it throws an exception and won't work when I run:
python -m camelot.bin.camelot_admin
Some versions:
In [1]: import camelot
In [2]: camelot.__version__
Out[2]: '12.06.29'
In [3]: import sqlalchemy
In [4]: sqlalchemy.__version__
Out[4]: '0.8.0b2'
This is the traceback:
Traceback (most recent call last):
File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/usr/local/lib/python2.7/dist-packages/camelot/bin/camelot_admin.py", line 263, in <module>
main()
File "/usr/local/lib/python2.7/dist-packages/camelot/bin/camelot_admin.py", line 255, in main
meta()
File "/usr/local/lib/python2.7/dist-packages/camelot/bin/camelot_admin.py", line 243, in meta
from camelot.bin.meta import launch_meta_camelot
File "/usr/local/lib/python2.7/dist-packages/camelot/bin/meta.py", line 34, in <module>
from camelot.admin.application_admin import ApplicationAdmin
File "/usr/local/lib/python2.7/dist-packages/camelot/admin/application_admin.py", line 34, in <module>
from camelot.admin.action import application_action, form_action, list_action
File "/usr/local/lib/python2.7/dist-packages/camelot/admin/action/__init__.py", line 25, in <module>
from application_action import ( ApplicationActionGuiContext,
File "/usr/local/lib/python2.7/dist-packages/camelot/admin/action/application_action.py", line 31, in <module>
from camelot.core.orm import Session
File "/usr/local/lib/python2.7/dist-packages/camelot/core/orm.py", line 48, in <module>
from sqlalchemy.ext.declarative import ( declarative_base,
ImportError: cannot import name _declarative_constructor

I downgraded to sqlalchemy 0.7.8 from 0.8 and cleaned up some previous installed files. Now it works great.

Related

When I execute this command (shub login), in python I get error. I execute this command after installing the shub package

Traceback (most recent call last):
File "C:\Users\mohammadprgrm\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Users\mohammadprgrm\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code
exec(code, run_globals)
File "C:\Users\mohammadprgrm\Desktop\py\env\Scripts\shub.exe\__main__.py", line 4, in <module>
File "C:\Users\mohammadprgrm\Desktop\py\env\lib\site-packages\shub\tool.py", line 7, in <module>
from shub.utils import update_available
File "C:\Users\mohammadprgrm\Desktop\py\env\lib\site-packages\shub\utils.py", line 42, in <module>
from scrapinghub import ScrapinghubClient, ScrapinghubAPIError, HubstorageClient
File "C:\Users\mohammadprgrm\Desktop\py\env\lib\site-packages\scrapinghub\__init__.py", line 13, in <module>
from .hubstorage import HubstorageClient
File "C:\Users\mohammadprgrm\Desktop\py\env\lib\site-packages\scrapinghub\hubstorage\__init__.py", line 6, in <module>
from .client import HubstorageClient
File "C:\Users\mohammadprgrm\Desktop\py\env\lib\site-packages\scrapinghub\hubstorage\client.py", line 8, in <module>
from .project import Project
File "C:\Users\mohammadprgrm\Desktop\py\env\lib\site-packages\scrapinghub\hubstorage\project.py", line 3, in <module>
from .job import Job
File "C:\Users\mohammadprgrm\Desktop\py\env\lib\site-packages\scrapinghub\hubstorage\job.py", line 2, in <module>
from .resourcetype import (ItemsResourceType, DownloadableResource,
File "C:\Users\mohammadprgrm\Desktop\py\env\lib\site-packages\scrapinghub\hubstorage\resourcetype.py", line 5, in <module>
from collections import MutableMapping
ImportError: cannot import name 'MutableMapping' from 'collections' (C:\Users\mohammadprgrm\AppData\Local\Programs\Python\Python310\lib\collections\__init__.py)
That version of the scrapinghub package is evidently not compatible with Python 3.10.
Downgrade to Python 3.9, or upgrade the package to a new, compatible version if there is one which there may not be yet: https://github.com/scrapinghub/python-scrapinghub/issues/160

Cannot run pip due to a circular import in pip itself

I created a new virtual environment, and installed a package (particularly, cvxpy). I ran some tests and it worked fine. Then, for no apparent reason, I started getting errors when running pip:
(.venv39a) PS D:\Dropbox\ariel-algorithms\cvxpy> python -m pip
Traceback (most recent call last):
File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "D:\Dropbox\ariel-algorithms\cvxpy\.venv39a\lib\site-packages\pip\__main__.py", line 29, in <module>
from pip._internal.cli.main import main as _main
File "D:\Dropbox\ariel-algorithms\cvxpy\.venv39a\lib\site-packages\pip\_internal\cli\main.py", line 9, in <module>
from pip._internal.cli.autocompletion import autocomplete
File "D:\Dropbox\ariel-algorithms\cvxpy\.venv39a\lib\site-packages\pip\_internal\cli\autocompletion.py", line 12, in <module>
from pip._internal.metadata import get_default_environment
File "D:\Dropbox\ariel-algorithms\cvxpy\.venv39a\lib\site-packages\pip\_internal\metadata\__init__.py", line 3, in <module> from .base import (BaseDistribution, BaseEnvironment, FilesystemWheel,
File "D:\Dropbox\ariel-algorithms\cvxpy\.venv39a\lib\site-packages\pip\_internal\metadata\base.py", line 22, in <module>
from pip._vendor.packaging.requirements import Requirement
File "D:\Dropbox\ariel-algorithms\cvxpy\.venv39a\lib\site-packages\pip\_vendor\packaging\requirements.py", line 12, in <module>
from pip._vendor.pyparsing import Combine
File "D:\Dropbox\ariel-algorithms\cvxpy\.venv39a\lib\site-packages\pip\_vendor\pyparsing\__init__.py", line 135, in <module>
from .common import _builtin_exprs as common_builtin_exprs
File "D:\Dropbox\ariel-algorithms\cvxpy\.venv39a\lib\site-packages\pip\_vendor\pyparsing\common.py", line 5, in <module>
from .helpers import any_close_tag, any_open_tag, delimited_list
File "D:\Dropbox\ariel-algorithms\cvxpy\.venv39a\lib\site-packages\pip\_vendor\pyparsing\helpers.py", line 5, in <module>
from . import __diag__
ImportError: cannot import name '__diag__' from partially initialized module 'pip._vendor.pyparsing' (most likely due to a circular import) (D:\Dropbox\ariel-algorithms\cvxpy\.venv39a\lib\site-packages\pip\_vendor\pyparsing\__init__.py)
It says there is a circular import in pip itself - how can this be?
I tried to remove the virtual environment and re-install everything, but after some time, it happened again. How can I debug this strange circular import, in pip itself?

ModuleNotFoundError: No module named 'spacy.lang.en.tag_map' when installing plasticityai / magnitude

Installed plasticityai/magnitude (https://github.com/plasticityai/magnitude#installation)
Getting the following error when trying to run:
ModuleNotFoundError: No module named 'spacy.lang.en.tag_map'
I have reinstalled spacy with newest version using pip3. Running python3.
Command I am trying to run:
python3 -m pymagnitude.converter -i /Users/rob/Desktop/videos/glove.6B/glove.6B.300d.txt -o /Users/rob/Desktop/vectors/
Full output:
Traceback (most recent call last):
File "/usr/local/Cellar/python#3.9/3.9.5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/runpy.py", line 188, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File "/usr/local/Cellar/python#3.9/3.9.5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/runpy.py", line 111, in _get_module_details
__import__(pkg_name)
File "/usr/local/lib/python3.9/site-packages/pymagnitude/__init__.py", line 80, in <module>
from pymagnitude.third_party.allennlp.commands.elmo import ElmoEmbedder
File "/usr/local/lib/python3.9/site-packages/pymagnitude/third_party/allennlp/commands/__init__.py", line 8, in <module>
from allennlp.commands.configure import Configure
File "/usr/local/lib/python3.9/site-packages/pymagnitude/third_party/allennlp/commands/__init__.py", line 13, in <module>
from allennlp.commands.predict import Predict
File "/usr/local/lib/python3.9/site-packages/pymagnitude/third_party/allennlp/commands/predict.py", line 54, in <module>
from allennlp.predictors.predictor import Predictor, JsonDict
File "/usr/local/lib/python3.9/site-packages/pymagnitude/third_party/allennlp/predictors/__init__.py", line 13, in <module>
from allennlp.predictors.constituency_parser import ConstituencyParserPredictor
File "/usr/local/lib/python3.9/site-packages/pymagnitude/third_party/allennlp/predictors/constituency_parser.py", line 7, in <module>
from spacy.lang.en.tag_map import TAG_MAP
ModuleNotFoundError: No module named 'spacy.lang.en.tag_map'' ```
Issue is version of Spacy installed via pip was incorrect. Uninstalled Spacy from global pip, and works fine.

Can't install python2 kernel for jupyter-notebook on MacOS

I'm trying to install the python2 kernel for jupyter notebook on my Macbook while following this page :
https://ipython.readthedocs.io/en/stable/install/kernel_install.html#kernels-for-python-2-and-3
..but get the following error, which is rather cryptic for a (kind of) newb like me :
Alexandres-MBP ~ python2.7 -m ipykernel install
Traceback (most recent call last):
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 162, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/Users/alex/Library/Python/2.7/lib/python/site-packages/ipykernel/__main__.py", line 2, in <module>
from ipykernel import kernelapp as app
File "/Users/alex/Library/Python/2.7/lib/python/site-packages/ipykernel/kernelapp.py", line 38, in <module>
from .iostream import IOPubThread
File "/Users/alex/Library/Python/2.7/lib/python/site-packages/ipykernel/iostream.py", line 25, in <module>
from jupyter_client.session import extract_header
File "/Users/alex/Library/Python/2.7/lib/python/site-packages/jupyter_client/session.py", line 51, in <module>
from dateutil.tz import tzutc
File "/Users/alex/Library/Python/2.7/lib/python/site-packages/dateutil/tz/__init__.py", line 2, in <module>
from .tz import *
File "/Users/alex/Library/Python/2.7/lib/python/site-packages/dateutil/tz/tz.py", line 19, in <module>
from six.moves import _thread
ImportError: cannot import name _thread
How do I solve that?
Oh and first post on Stack Overflow so I hope I'm asking in the right place.
Edit : forgot to mention I installed everything with brew.

Scrapy giving errors when trying to start project

Just installed with pip I'm using 2.7 I have uninstalled and reinstalled
this is what it's giving me I don't know if it works besides this since I can't get this to run
C:\Users>scrapy startproject tutorial
Traceback (most recent call last):
File "C:\Anaconda\lib\runpy.py", line 162, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "C:\Anaconda\lib\runpy.py", line 72, in _run_code
exec code in run_globals
File "C:\Anaconda\Scripts\scrapy.exe\__main__.py", line 5, in <module>
File "C:\Anaconda\lib\site-packages\scrapy\__init__.py", line 56, in <module>
from scrapy.spider import Spider
File "C:\Anaconda\lib\site-packages\scrapy\spider.py", line 7, in <module>
from scrapy.http import Request
File "C:\Anaconda\lib\site-packages\scrapy\http\__init__.py", line 10, in <mod
ule>
from scrapy.http.request import Request
File "C:\Anaconda\lib\site-packages\scrapy\http\request\__init__.py", line 10,
in <module>
from w3lib.url import safe_url_string
File "C:\Anaconda\lib\site-packages\w3lib\url.py", line 9, in <module>
from six import moves
ImportError: cannot import name moves
I don't know what to do

Categories

Resources