I'm trying to use the responder package (https://github.com/taoufik07/responder) in a conda environment. But I'm getting the following error:
conda create --name tmp python=3.7
conda activate tmp
conda install -c conda-forge responder
python -c "import responder;"
And then I get this:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/x/opt/anaconda3/envs/dex/lib/python3.7/site-packages/responder/__init__.py", line 1, in <module>
from .core import *
File "/Users/x/opt/anaconda3/envs/dex/lib/python3.7/site-packages/responder/core.py", line 1, in <module>
from .api import API
File "/Users/x/opt/anaconda3/envs/dex/lib/python3.7/site-packages/responder/api.py", line 20, in <module>
from . import models, status_codes
File "/Users/x/opt/anaconda3/envs/dex/lib/python3.7/site-packages/responder/models.py", line 12, in <module>
import graphene
File "/Users/x/opt/anaconda3/envs/dex/lib/python3.7/site-packages/graphene/__init__.py", line 19, in <module>
from .types import (
File "/Users/x/opt/anaconda3/envs/dex/lib/python3.7/site-packages/graphene/types/__init__.py", line 7, in <module>
from .scalars import Scalar, String, ID, Int, Float, Boolean
File "/Users/x/opt/anaconda3/envs/dex/lib/python3.7/site-packages/graphene/types/scalars.py", line 2, in <module>
from graphql.language.ast import (BooleanValue, FloatValue, IntValue,
ImportError: cannot import name 'BooleanValue' from 'graphql.language.ast' (/Users/x/opt/anaconda3/envs/dex/lib/python3.7/site-packages/graphql/language/ast.py)
I think You haven't activated the Conda environment
MANUAL PROCESS
above error is not module error that import error so in that module something is missing go to the site-packages and into that library then check the code
REINSTALLING
remove that library, and re-install through the pip OR below command, check the python version.
$ pipenv install responder
$ pipenv install -e git+https://github.com/taoufik07/responder.git#egg=responder
Related
This is the full error message.
Traceback (most recent call last):
File "C:\Users\adi\OneDrive\Desktop\Python310\machine learning project.py", line 3, in <module>
import streamlit as st
File "C:\Users\adi\OneDrive\Desktop\Python310\lib\site-packages\streamlit\__init__.py", line 70, in <module>
from streamlit.delta_generator import DeltaGenerator as _DeltaGenerator
File "C:\Users\adi\OneDrive\Desktop\Python310\lib\site-packages\streamlit\delta_generator.py", line 19, in <module>
from streamlit import cursor, caching
File "C:\Users\adi\OneDrive\Desktop\Python310\lib\site-packages\streamlit\cursor.py", line 18, in <module>
from streamlit.scriptrunner import get_script_run_ctx
File "C:\Users\adi\OneDrive\Desktop\Python310\lib\site-packages\streamlit\scriptrunner\__init__.py", line 16, in <module>
from .script_runner import (
File "C:\Users\adi\OneDrive\Desktop\Python310\lib\site-packages\streamlit\scriptrunner\script_runner.py", line 35, in <module>
from streamlit.state import (
File "C:\Users\adi\OneDrive\Desktop\Python310\lib\site-packages\streamlit\state\__init__.py", line 27, in <module>
from .session_state_proxy import (
File "C:\Users\adi\OneDrive\Desktop\Python310\lib\site-packages\streamlit\state\session_state_proxy.py", line 24, in <module>
from streamlit.type_util import Key
File "C:\Users\adi\OneDrive\Desktop\Python310\lib\site-packages\streamlit\type_util.py", line 22, in <module>
import pyarrow as pa
File "C:\Users\adi\OneDrive\Desktop\Python310\lib\site-packages\pyarrow\__init__.py", line 65, in <module>
import pyarrow.lib as _lib
I am working with streamlit for a project but can't work out this problem.
I have tried uninstalling and reinstalling streamlit but that did'nt help.
i using python 3.8
Uninstalling and re-installing solved the issue for me:
pip uninstall pyarrow
pip install pyarrow
I think I messed things up by changing the Python version in my Conda environment.
You need to install pyarrow
python3 -m pip install pyarrow
Check these 2 things(worked for me) -
1-If you have changed your python version recently, uninstall all libraries then install.(can be done easily by pip uninstall -r requirements.txt -y & then pip install -r requirements.txt -y
2- If you have installed pyarrow in a different environment.
I set up my development environment on Fedora 35 and when I run any brownie command such as $ brownie console or even brownie --version I get the following error:
Traceback (most recent call last):
File "/home/philippbunke/.local/bin/brownie", line 5, in <module>
from brownie._cli.__main__ import main
File "/home/philippbunke/.local/pipx/venvs/eth-brownie/lib64/python3.10/site-packages/brownie/__init__.py", line 6, in <module>
from brownie.project import compile_source, run
File "/home/philippbunke/.local/pipx/venvs/eth-brownie/lib64/python3.10/site-packages/brownie/project/__init__.py", line 3, in <module>
from .main import ( # NOQA 401
File "/home/philippbunke/.local/pipx/venvs/eth-brownie/lib64/python3.10/site-packages/brownie/project/main.py", line 44, in <module>
from brownie.network import web3
File "/home/philippbunke/.local/pipx/venvs/eth-brownie/lib64/python3.10/site-packages/brownie/network/__init__.py", line 4, in <module>
from .account import Accounts
File "/home/philippbunke/.local/pipx/venvs/eth-brownie/lib64/python3.10/site-packages/brownie/network/account.py", line 12, in <module>
import eth_account
File "/home/philippbunke/.local/pipx/venvs/eth-brownie/lib64/python3.10/site-packages/eth_account/__init__.py", line 1, in <module>
from eth_account.account import ( # noqa: F401
File "/home/philippbunke/.local/pipx/venvs/eth-brownie/lib64/python3.10/site-packages/eth_account/account.py", line 8, in <module>
from cytoolz import (
File "/home/philippbunke/.local/pipx/venvs/eth-brownie/lib64/python3.10/site-packages/cytoolz/__init__.py", line 3, in <module>
from .functoolz import *
ImportError: /home/philippbunke/.local/pipx/venvs/eth-brownie/lib64/python3.10/site-packages/cytoolz/functoolz.cpython-310-x86_64-linux-gnu.so: undefined symbol: _PyGen_Send
Setup:
Python=3.10.1
Cython=0.29.26
gcc/gcc-c=11.2.1-7.fc35.x86_64
Ganache CLI=v6.12.2
$ pipx list
venvs are in /home/philippbunke/.local/pipx/venvs
apps are exposed on your $PATH at /home/philippbunke/.local/bin
package eth-brownie 1.16.4, Python 3.10.1
- brownie
$ $PATH
/home/philippbunke/.local/bin:/home/philippbunke/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/var/lib/snapd/snap/bin
I have spent a whole day trying to fix this error, please help me out!
The problem here seems to be Python 3.10.1!
I used anaconda to create a new virtual environment with Python 3.8.12, installed brownie using pipx install --python python3.8 eth-brownie and it worked!
The trick here was, to also tell pipx to use another python version, otherwise it would create a dependency to the global python version, which is python 3.10 in my case.
I just did a conda install of a few packages to follow a tutorial, and now I can't even import pandas.
I installed these:
fake-factory==0.7.2
Faker==0.7.3
pytz==2016.7
tzlocal==1.3.0
And now I get this:
>>> import pandas
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\ProgramData\Anaconda3\envs\ariel\lib\site-packages\pandas\__init__.py", line 42, in <module>
from pandas.core.api import *
File "C:\ProgramData\Anaconda3\envs\ariel\lib\site-packages\pandas\core\api.py", line 7, in <module>
from pandas.core.arrays.integer import (
File "C:\ProgramData\Anaconda3\envs\ariel\lib\site-packages\pandas\core\arrays\__init__.py", line 2, in <module>
from .base import (ExtensionArray, # noqa
File "C:\ProgramData\Anaconda3\envs\ariel\lib\site-packages\pandas\core\arrays\base.py", line 21, in <module>
from pandas.core import ops
File "C:\ProgramData\Anaconda3\envs\ariel\lib\site-packages\pandas\core\ops\__init__.py", line 21, in <module>
from pandas.core.construction import extract_array
File "C:\ProgramData\Anaconda3\envs\ariel\lib\site-packages\pandas\core\construction.py", line 18, in <module>
from pandas.core.dtypes.base import ExtensionDtype, registry
ImportError: cannot import name 'registry' from 'pandas.core.dtypes.base' (C:\ProgramData\Anaconda3\envs\ariel\lib\site-packages\pandas\core\dtypes\base.py)
I tried doing a conda update pandas, but to no avail.
I also just installed luigi, not quite sure when it broke as I installed all the additional packages in one go.
Updated version of pandas package using pip3
try this in python3
pip3 install --upgrade pandas
Try updating pandas package in Anaconda:
conda install pandas=1.1.4
If no luck, try updating all packages:
conda update --all
Worked in my case.
I´m a newbie to conda, I only have a very surface-level understanding of how it works.
My objective was to install an annotation software (dammit) using conda.
Conda was installed as follows:
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh && bash miniconda.sh -b -p $HOME/miniconda
echo 'export PATH="$HOME/miniconda/bin:$PATH"' >> $HOME/.bashrc
Then I created an environment, set up the channels, and installed my software:
conda create -n dammit python=3
source activate dammit
conda config --add channels defaults
conda config --add channels conda-forge
conda config --add channels bioconda
conda install dammit
When I tried to run the main script an error occurred
Traceback (most recent call last):
File "./dammit", line 5, in <module>
from dammit import app
File "/home/up201505534/miniconda/envs/dammit/lib/python3.6/site-packages/dammit/app.py", line 13, in <module>
from dammit import annotate
File "/home/up201505534/miniconda/envs/dammit/lib/python3.6/site-packages/dammit/annotate.py", line 13, in <module>
from shmlast.app import CRBL
File "/home/up201505534/miniconda/envs/dammit/lib/python3.6/site-packages/shmlast/app.py", line 3, in <module>
from doit.tools import run_once, create_folder
File "/home/up201505534/miniconda/envs/dammit/lib/python3.6/site-packages/doit/__init__.py", line 33, in <module>
from doit.doit_cmd import get_var
File "/home/up201505534/miniconda/envs/dammit/lib/python3.6/site-packages/doit/doit_cmd.py", line 14, in <module>
from .cmd_run import Run
File "/home/up201505534/miniconda/envs/dammit/lib/python3.6/site-packages/doit/cmd_run.py", line 8, in <module>
from .runner import Runner, MRunner, MThreadRunner
File "/home/up201505534/miniconda/envs/dammit/lib/python3.6/site-packages/doit/runner.py", line 8, in <module>
import cloudpickle
File "/home/up201505534/miniconda/envs/dammit/lib/python3.6/site-packages/cloudpickle/__init__.py", line 7, in <module>
from cloudpickle.cloudpickle import *
File "/home/up201505534/miniconda/envs/dammit/lib/python3.6/site-packages/cloudpickle/cloudpickle.py", line 61, in <module>
import typing
File "/opt/lib/python2.7/site-packages/typing.py", line 624, in <module>
AnyStr = TypeVar('AnyStr', bytes, unicode)
It appears the problem is in the typing package in the python 2.7 libs. I have installed typing.py with conda in the dammit environment, however the same error occurs. How can I fix this, and have the "import command" to search in the dammit/lib/python lib instead?
Here is the sys.path:
['', '/opt/python', '/opt/lib64/python2.7/site-packages', '/opt/lib/python2.7/site-packages', '/opt/lib64/python3.7/site-packages', '/opt/lib/python3.7/site-packages', '/home/up201505534', '/home/up201505534/miniconda/envs/dammit/lib/python36.zip', '/home/up201505534/miniconda/envs/dammit/lib/python3.6', '/home/up201505534/miniconda/envs/dammit/lib/python3.6/lib-dynload', '/home/up201505534/miniconda/envs/dammit/lib/python3.6/site-packages']
and the PYTHONPATH:
/opt/python:/opt/lib64/python2.7/site-packages:/opt/lib/python2.7/site-packages:/opt/lib64/python3.7/site-packages:/opt/lib/python3.7/site-packages:
Today I installed python 3.7 from apt-get to try out the new dataclasses module. I installed it seperately because python3.6 wasn't upgradeable to 3.7.
When I type: python3.7 --version, it gives me: >>> Python 3.7.0a2 as my current version.
The problem is that I can't seem to import dataclasses.
my import statement is: from dataclasses import dataclass as instructed here
This is the error message it's giving me:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'dataclasses'
Error in sys.excepthook:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 63, in apport_excepthook
from apport.fileutils import likely_packaged, get_recent_crashes
File "/usr/lib/python3/dist-packages/apport/__init__.py", line 5, in <module>
from apport.report import Report
File "/usr/lib/python3/dist-packages/apport/report.py", line 30, in <module>
import apport.fileutils
File "/usr/lib/python3/dist-packages/apport/fileutils.py", line 23, in <module>
from apport.packaging_impl import impl as packaging
File "/usr/lib/python3/dist-packages/apport/packaging_impl.py", line 24, in <module>
import apt
File "/usr/lib/python3/dist-packages/apt/__init__.py", line 23, in <module>
import apt_pkg
ModuleNotFoundError: No module named 'apt_pkg'
Original exception was:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'dataclasses'
I even tried installing the dataclasses module with pip3: pip3 install dataclasses. Not sure if that's necessary though.
Any suggestion on what might be the problem?
[EDIT] Just tried it with a python3.6 console and it worked fine .. weird.
As suggested by #wim python3.7 -m venv venv_dir
This command will:
Use python3.7 to run the command
The -m flag tells the interpreter to run the next argument as a script
venv is a module, and because of the -m flag it will be run as a script
Finally, the venv_dir is given to the venv module as an argument which
this module will use to create a virtual environment directory at
Once this command is run now you'll have a nice sandbox for messing around/testing the dataclasses module.
To activate this virtual environment be sure to run source venv_dir/bin/activate before you begin. This command will run the script at venv_dir/bin/activate to set up the necessary environment variables and other things for you
To deactivate, simply run deactivate after activating