Scrapy Installation Error: [CondaEnvironmentNotFoundError] : could not find environment: base - scrapy

I'm currently trying to install scrapy when I encountered my first error:
ERROR conda.core.link:_execute_actions(337): An error occurred while installing package 'conda-forge::automat-0.7.0-py_1'.
CondaError: Cannot link a source that does not exist. D:\ProgramFiles\Python\Scripts\conda.exe
Running conda clean --packages may resolve your problem.
Attempting to roll back.
CondaError: Cannot link a source that does not exist. D:\ProgramFiles\Python\Scripts\conda.exe
Running conda clean --packages may resolve your problem.
I researched this error and followed the advice on this link:
My issues were largely similar to his until I reached the comment which advised me to run conda update -n base conda.
When I ran this code, I encountered my next error:
CondaEnvironmentNotFoundError: Could not find environment: base .
You can list all discoverable environments with conda info --envs.
Kindly advice if my steps taken were appropriate and how can I fix this issue.
The weird thing is I installed scrapy before, and these errors occurred after I recently re-installed Anaconda.
I'm not sure what other info you might require to better understand the situation. Do let me know and I will assist promptly.
Thank You

Try the conda install scrapy channel instead of the conda-forge channel.
To understand the difference between these two channels please read the answer of the following question Should conda, or conda-forge be used for Python environments?

Related

doc_controls has not attribute 'inheritable headers'

I'm starting this thread with an answer, not a question. The questions are stated at the end:
I tried to add pip package 'tfx' to Apache Airflow using my own Dockerfile and docker-compose.yaml. I added my own DAG to Airflow and that failed to load with this error message:
doc_controls has not attribute 'inheritable_header'
It cost me only a day to find the cause. When you add this to your Dockerfile..
pip install tfx
..pip will install txf, tensorflow-2.6.0 and tensorflow-estimator-2.7.0. The latter is apparently depending on the not-yet-released code in the github repo tensorflow/docs which contains doc_controls.
So instead add this to keep tensorflow-estimator in line with packages that pip can find:
RUN pip install --no-cache-dir --user \
tfx==1.3.1 \
tensorflow==2.6.0 \
tensorflow-estimator==2.6.0
I'm loosing a lot of time solving problems with dependencies between pip packages and pip packages and the underlying C/C++ libraries. Am I the only one?
Here are my questions:
Am I correct to assume that pip is supposed to figure out which versions of dependencies of tfx to install. Should I normally be able to rely on pip to do this correctly or will pip simply install the latest version of all dependencies without regard to their mutual compatibility?
On the internet there are many Dockerfile around that do not specify any version numbers of the apt/pip packages to install. Such a Dockerfile is like a box of chocolates right? If you build the dockerfile a time t1 and at time t2 then their contents can differ in terms of versions right?
In general: Given a docker image why can one not get the Dockerfile that was used to construct the docker image?
Regards,
Chris
I also keep running into these dependency issues recently. I came across another post which might be of interest: Resolving new pip backtracking runtime issue. Based off this I think pip does try to figure out what versions of packages to install to avoid conflicts but I guess it sometimes struggles. I tried one of the tools, pipreqs but I didn't find it useful for my particular problem. In fact it broke things even more.
Also thanks for the solution to this one, I had the same problem.

Can't install cgal-qt5 using brew install cgal-qt5

I have followed the website of CGAL. It told me that I could install it by using the command
brew install cgal-qt5.
But I have received the following error message:
Updating Homebrew...
Error: No available formula with the name "cgal-qt"
==> Searching for a previously deleted formula (in the last month)...
Warning: homebrew/core is shallow clone. To get complete history run:
git -C "$(brew --repo homebrew/core)" fetch --unshallow
Error: No previously deleted formula found.
==> Searching for similarity named formulae...
Error: No similarly named formula found.
==> Searching taps...
==> Searching taps on GitHub...
Error: No formulae found in tabs.
And when I run the example draw_triangulation_2.cpp, it has a fatal error:
'CGAL/Qt/Basic_viewer_qt.h' file not found
I guess this result is generated because of the lack of cgal-qt5, but I cannot fix it. I hope someone can help me. Thanks.
Actually the doc here is wrong. The PR for this was never accepted, and the doc about cgal on brew was published before the cancellation of the PR. On brew, you can install cgal with brew install cgal but you won't have the GUI elements in that package until this PR is integrated.

Error when installing a python module in Linux

I am encoutering two kinds of issues while trying to install a package called Boltztrap2.
1) Trying to install Boltztrap2 using 'pip3'. However, when I punch in the command, the process goes smoothly for a while and then spits out an error :
BoltzTraP2/sphere/frontend.cpp:32:20: fatal error: Python.h: No such file or directory
#include "Python.h"
^
compilation terminated.
error: command 'gcc' failed with exit status 1
I did some troubleshooting and found out that it is just a path issue - I confirmed this by typing 'locate Python.h'. However, I don't get how to manually incorporate this change since the 'pip3' command that I use downloads the program and compiles it automatically. I don't seem to have access to change any scripts, or rather I do not know how to, since I'm kind of new to all this.
PS: I do not have sudo access.
2) Trying to install Boltztrap2 by manually compiling the python setup file: This seems to work fine until the system spits out an error saying:
Error:numpy is not installed.
PS: Again, I do not have sudo access.
I would be very glad if someone could help me install this package through either method. I just want to get the software to work. Thanks in advance for any assistance.
python3 -m pip install --upgrade pip
pip3 install numpy
Check if you can upgrade pip?
If that works then you can pip install numpy.

Can you use rmagic (rpy2) in google colaboratory?

I know google colaboratory doesn't yet support an R kernel. What about rmagic? Can I use rpy2?
I tried :
!pip install rpy2==2.8.6
And got :
Collecting rpy2==2.8.6
Using cached https://files.pythonhosted.org/packages/32/54/d102eec14f9cabd0df60682a38bd45c36169a1ec8fb8a690bf436cb6d758/rpy2-2.8.6.tar.gz
Complete output from command python setup.py egg_info:
Error: Tried to guess R's HOME but no command 'R' in the PATH.
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-3bSiiD/rpy2/
I'm guessing that it isn't working because R isn't installed on whatever cloud machine this notebook is running on, and that it probably isn't possible to install it. But I'm hoping I'm wrong and someone may know of a work around.
OK, I answered my own question. I thought for sure this would fail, but tried anyway:
!apt-get update
!apt-get install r-base
!pip install rpy2==2.8.6
And it worked!

Upload package to pypi moans "must use HTTPS"

When executing this from the command-line of within my package:
python setup.py sdist bdist_egg upload
I get:
Server response (403): Must access using HTTPS instead of HTTP
This used to work many times until now. Searching for the err-msg didn't give me helpful infos, has anyone a clue what's going on?
Update: Use twine for uploading distributions to pypi.
Are you using a .pypirc file?
If you are maybe change the urls to point to the https links?
[distutils]
index-servers =
pypi
pypitest
[pypi]
repository=https://pypi.python.org/pypi
username=your_username
password=your_password
[pypitest]
repository=https://testpypi.python.org/pypi
username=your_username
password=your_password
Updating setuptools let's the error dissapear:
pip install setuptools -U
Then running the upload-command ends with:
Submitting dist/my.packagename-1.3.tar.gz to https://upload.pypi.org/legacy/
error: None
But still, no new version is available at pypi.