I get this message whenever I try to run conda commands inside an environment with python.
Trigger method:
- Run
conda create -n myenv python
- Run
conda activate myenv
- Run any conda commands, such as
conda activate
orconda deactivate
orconda install numpy
I think this might be a noob question, but I can’t find much about it. How may I solve this.
Note, I have run conda init zsh
. It (should) work, as there are lines about conda appended to .zshrc, however, the command erred like follows:
Traceback (most recent call last):
File "/usr/lib/python3.11/site-packages/conda/exceptions.py", line 1124, in __call__
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/conda/cli/main.py", line 69, in main_subshell
exit_code = do_call(args, p)
^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/conda/cli/conda_argparse.py", line 91, in do_call
return getattr(module, func_name)(args, parser)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/conda/cli/main_init.py", line 33, in execute
return initialize(context.conda_prefix, selected_shells, for_user, args.system,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/conda/core/initialize.py", line 118, in initialize
run_plan_elevated(plan2)
File "/usr/lib/python3.11/site-packages/conda/core/initialize.py", line 714, in run_plan_elevated
result = subprocess_call(
^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/conda/gateways/subprocess.py", line 98, in subprocess_call
stdout, stderr = process.communicate(input=stdin)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/subprocess.py", line 1209, in communicate
stdout, stderr = self._communicate(input, endtime, timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/subprocess.py", line 2088, in _communicate
input_view = memoryview(self._input)
^^^^^^^^^^^^^^^^^^^^^^^
TypeError: memoryview: a bytes-like object is required, not 'str'
I also have to mention if the environment does not contain python, conda commands can still run normally.