Issues with installing tweepy with Anaconda - python

I'm getting this error while trying to install Tweepy Package for python (i'm working with anconda prompt):
ERROR conda.core.link:_execute_actions(337): An error occurred while installing package 'conda-forge::pyjwt-1.5.3-py_0'.
CondaError: Cannot link a source that does not exist. C:\ProgramData\Anaconda2\Scripts\conda.exe
Running `conda clean --packages` may resolve your problem.
Attempting to roll back.
CondaError: Cannot link a source that does not exist. C:\ProgramData\Anaconda2\Scripts\conda.exe
Running `conda clean --packages` may resolve your problem.
I followed the suggestion and ran 'conda clean --packages' and then tried to install it again, using conda install -c conda-forge tweepy, suffice to say it didn't work and I'm getting the following error :
ERROR conda.core.link:_execute_actions(337): An error occurred while installing package 'conda-forge::pyjwt-1.5.3-py_0'.
CondaError: Cannot link a source that does not exist. C:\ProgramData\Anaconda2\Scripts\conda.exe
Running `conda clean --packages` may resolve your problem.
Attempting to roll back.
CondaError: Cannot link a source that does not exist. C:\ProgramData\Anaconda2\Scripts\conda.exe
Running `conda clean --packages` may resolve your problem.
Any help here? I'm using python 2.7, Anconda2-5.0.1 and Windows 10

I got the same exact error as yours. If you check tweepy's Github https://github.com/tweepy/tweepyyou you will read that the easiest way to install tweepy is by using pip, so you should follow that way instead.
So in case you haven't installed pip using conda, then type at the conda command prompt
conda install pip
Then again on the command prompt
pip install tweepy
It should work now

Related

How can i solve the following problem with pip?[Could not install packages due to an OSError]

My virtual environment is accidentally not working. i found out this message when i tried to add new package to my virtual environment My problem is as following:
I've run this command.[$ pip install <package_name>]
But i met an error message.
ERROR: Could not install packages due to an OSError: Missing dependencies for SOCKS support.
How can i fix the error? I need detailed information.
what did i try?
1.upgrade my pip version.
2.create new VENV(for python project).
How can i fix the error? pls, I need detailed information.
Try writing "pip3 install <package_name>"
Sometimes depending on what compiler or OS you are using there could be differences in installing packages. I had the same problem a while ago and writing "pip3" instead of just "pip" fixed the problem for me.
However, from the error code you're getting, that may not be the case. I assume you are on ubuntu so I would suggest running
$ env | grep -i proxy
then
$ unset socks_proxy

Error "Invalid version: '0.23ubuntu1' (package: distro-info)"

Originally, my app crashed with error ERROR: Failed building wheel for pycairo (in the picture)
Failed to build pycairo
I tried to fix it by running several commands
sudo apt install libcairo2-dev
sudo apt install cloud-init
Gave the same error. No fix.
then I tried uninstalling the requirements.txt and reinstalled
pip uninstall -r requirements.txt
pip install -r requirements.txt
Did not solve the issue.
then I tried the below command, but I still got the same error "Failed building wheel for pycairo":
pip3 install --upgrade pip (from this thread: ERROR: Could not build wheels for scipy which use PEP 517 and cannot be installed directly
then I tried this command:
pip install --upgrade pip setuptools wheel
and I got this error in the picture: "Invalid version: '0.23ubuntu1'"
Invalid version: '0.23ubuntu1'
I tried to also delete this package but it's showing that package not found:
command I used: sudo apt-get remove distro-info
Error:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package 'distro-info' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 283 not upgraded.
I searched for solutions but did not find any regarding the error "Invalid version: '0.23ubuntu1'". Now, when I run "flask run", I get error: -bash: /home/ktai/.local/bin/flask: No such file or directory
Would appreciate any help!
I tried several command lines but nothing worked
I learned from this answer that there is a "bug" with versions of setuptools causing this specific Invalid version: '0.23ubuntu1' error.
Despite seeing errors with all sorts of pip commands including pip install, I was surprised to see that this downgrade command (from the answer linked) appears to resolve the issue:
pip install --upgrade --user setuptools==58.3.0
Are you using ubuntu 20.04 by chance?
I had a similar issue but it had to do nothing with pycairo so the situation might be different for you.
The existence of distro-info (with a version not compliant to PEP-440) among my Python packages was leading to the error message from your post's title whenever i tried to install another package.
For me, this one helped: (so you were close with the apt-get remove...)
python3 -m pip uninstall -y distro-info
In my case, it seems like it didnt break anything important so i will keep it like this.
But there is no guarantee the same works for you as well. Also, you might get it back the next time you install packages from your requirements.txt file.
If I understood this thread correctly, there might be updates with a compliant version of this package depending on which Ubuntu version you are using.
This error arises from PEP 440 (Python Enhancement Proposal #440), which enforces conventions for naming of Python packages, and this error seems to really only happen on Debian-based distros like Ubuntu. For example, I have been trying to install a package via pip and get an error:
pkg_resources.extern.packaging.version.InvalidVersion: Invalid version: '1.1build1' (package: distro-info)
So it's telling us that 1.1build1 is an invalid version name per PEP 440, and it's probably getting the distro-info package from, in my case, Ubuntu (came preinstalled).
I can get around this by using a Python virtual environment and not allowing it to use system-site-packages, sometimes called "global packages".
The solution is to remove the offending package and reinstall a version of it that meets PEP 440 requirements (e.g. following the "0.0.0" convention. "1.2.0" for example is fine, "1.2build3" is not).
pip uninstall -y distro-info
pip install distro-info==1.0
Additionally, within PyCharm, I can navigate to the Python Interpreter settings, choose the interpreter I am using from the Python Interpreter dropdown, and confirm that the version of distro-info it's trying to use is 1.1build1. To "upgrade" this to 1.0, I can double-click on the "1.0" under the "Latest Version" column and select "Install Package" from the modal that pops up.
If this or the above command to remove distro-info isn't working, you can use this same window to remove distro-info and then simply run pip install distro-info==1.0.
Thank you for all the answers. To answer my own question, I was finally able to fix the issue by updating all the required packages.
Now there are no updates needed, and the app works again.
0 updates can be applied immediately.
The list of available updates is more than a week old.
To check for new updates run: sudo apt update

pip3 cannot determine archive format - atlasplots installation

i am trying to install Atlas Plots, but i am getting some errors. I tried to install it with the following command line:
pip3 install https://github.com/joeycarter/atlas-plots
But when i run it, terminal shows me the following error:
Cannot determine archive format of /tmp/pip-req-build-o2c8xrmg
And this command line is the only option available in the installation tutorial on the software site, which is:
https://atlas-plots.readthedocs.io/en/latest/getting_started.html#installing-atlasplots
And i need this atlasplots in my research, so i would appreciate any help.
The correct syntax to install from a Github repo are:
pip install "git+https://github.com/joeycarter/atlas-plots.git#egg=atlasplots"
or
pip install "git+ssh://git#github.com/joeycarter/atlas-plots.git#egg=atlasplots"
See the docs at https://pip.pypa.io/en/stable/cli/pip_install/#vcs-support
Report the problem at https://github.com/joeycarter/atlas-plots/issues or better send a pull request fixing https://github.com/joeycarter/atlas-plots/blob/master/docs/getting_started.rst

Unable to install "Turicreate" on my Windows 10

I am new to Python and I am trying to build a recommendation engine by following a tutorial. The tutorials asks me to install turicreate, I am running Spyder 3.3.0 (Python version 3.5) on Anaconda.
WHAT I TRIED -
I sought help from various SO questions as well as github, but none helped. I tried using "pip" and it gave the following error-
Failed building wheel for turicreate
Running setup.py clean for turicreate
Failed to build turicreate
Tried "conda install ", but error again.
Solving environment: failed
PackagesNotFoundError: The following packages are not available from current channels:- turicreate
My "pip" and "conda" and "anaconda" are up to date. I tried creating a virtual environment and then installing "turicreate", but didn't help. I visited the anaconda.org website which had "conda install -c derickl turicreate", I tried, which gave the following error.
PackagesNotFoundError: The following packages are not available from current channels:- turicreate
Any help would be much appreciated.
If you go to the page of the turicreate package on the Python repository index (PyPI), you will find that it can only be installed natively on Linux and macOS.
The only way to use it on Windows is through the Windows Subsystem for Linux, and for that you need to install Anaconda or Python on it (I think, I've never used WSL).
I think your problem already solved :). But I had a similar problem and I solved it using a different way. I am posting it because I think it will help someone in the future. First, I want to say, If you are following something like a Video tutorial as mentioned in the question above, use that method. Thanks!
First Goto this Link URL. It will navigate you to colab with python version 2.
My runtime settings as follows. Runtime type: python 2 | Hardware accelerator:
TPU
Then run !pip install turicreate and after finishing installation it will say You must restart the runtime in order to use newly installed versions.After restart your runtime you will able to use turicreate with colab.
I hope it will help someone!

Python (anaconda) add packages with pip behind proxy

sorry for asking a probalby stupid question, however, I am completely new to setting up/installing python packages, i.e. I have never done it.
So far I installed anaconda3 and worked with the pre installed packages. Now I need the google api pyhon client.
I do not even know whether pip is installed in the anaconda package but I assume it.
What have I tried so far:
In Windows cmd:
1. pip install --upgrade google-api-python-client
2. pip install -- proxy="XXX.XXX.XX.X:XX" -- upgrade google-api-python-client
3. export https_proxy="...."
pip install --upgrade google-api-python-client
I get the following errors:
cannot fetch index base url https://pypi.python.org/simple
unknown command
unknown command
In addition I tried to download the google_api_python_client and unzipped it.
However, I do not know how to proceed here.
BTW: Here in my company we are still on XP
Any help would be highly appreciated!
THANK YOU
Would like to add to the answer by #alok-nayak that you should use the following:
python setup.py install
Leads to:
Installed ~/anaconda/lib/python2.7/site-packages/google_api_python_client-1.4.2-py2.7.egg
After unzipping google_api_python_client. You should run the setup.py file
python setup.py
Also you can edit ".condarc" file in your home folder, as explained here http://conda.pydata.org/docs/config.html . enter your proxy details there

Categories

Resources