Yum is not working in my Amazon Linux 1 instance [closed] - amazon-web-services

Closed. This question is not about programming or software development. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 4 days ago.
Improve this question
This is in an EC2 instance with Amazon Linux 1
I'm trying to uninstall php-5.6 due to security concerns, but when I run: yum remove php-5.6 I obtaine:
There was a problem importing one of the Python modules
required to run yum. The error leading to this problem was:
/usr/lib64/python2.7/dist-packages/pycurl.so: undefined symbol: CRYPTO_num_locks
Please install a package which provides this module, or
verify that the module is installed correctly.
It's possible that the above module doesn't match the
current version of Python, which is:
2.7.18 (default, Feb 18 2021, 06:10:44)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-28)]
If you cannot solve this problem yourself, please go to
the yum faq at:
http://yum.baseurl.org/wiki/Faq
I remember that some time ago I had to update curl libraries using a package that was not included in the repos. Maybe that's related to this issue.
The thing is that I donĀ“t know how to deal with this issue. How could I fix yum or uninstall php-5.6 manually at least.... It would be nice to know if I have installed packages that depend on php-5.6, but that's another yum command that does not work.
I tried to install pycurl using pip, but that does not work:
# pip install pycurl
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
Requirement already satisfied: pycurl in /usr/lib64/python2.7/dist-packages (7.19.0)
# pip uninstall pycurl
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
Found existing installation: pycurl 7.19.0
ERROR: Cannot uninstall 'pycurl'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.
I think I could try to install a RPM package, but I'm not sure about what version should I use.

Related

I cant install PIP on python 2.7

SO when i try to install pip i get this error message any help
i am using python 2.7 because the course uses dependencies from python 2 so ya i cant use python 3 any help is greatly appreciated
python get-pip.py
this is the command i typed
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
f:\temp\temp\tmpbwi9va\pip.zip\pip\_vendor\urllib3\util\ssl_.py:424: SNIMissingWarning: An HTTPS request has been made, but the SNI (Server Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
f:\temp\temp\tmpbwi9va\pip.zip\pip_vendor\urllib3\util\ssl_.py:164: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
ERROR: Could not find a version that satisfies the requirement pip<21.0 (from versions: none)
ERROR: No matching distribution found for pip<21.0

How to install h5py for version 1.10

I am using tensorflow in a python module, which is called by a c++ file. I moved to a new computer, where I installed ros again. So it works on one computer, but not on the other. There I got the following error:
UserWarning: h5py is running against HDF5 1.10.0 when it was built against 1.10.4, this may cause problems '{0}.{1}.{2}'.format(*version.hdf5_built_version_tuple)
then I did:
pip2.7 uninstall h5py
pip2.7 install h5py==1.10.4
but then I get the following error:
No handlers could be found for logger "keyring.backend"
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Defaulting to user installation because normal site-packages is not writeable
ERROR: Could not find a version that satisfies the requirement h5py==1.10.4 (from versions: 2.2.1, 2.3.0b1, 2.3.0, 2.3.1, 2.4.0b1, 2.4.0, 2.5.0, 2.6.0, 2.7.0rc2, 2.7.0, 2.7.1, 2.8.0rc1, 2.8.0, 2.9.0rc1, 2.9.0, 2.10.0)
ERROR: No matching distribution found for h5py==1.10.4
It seems like there is no 1.10.4 version. What should I do?
I have to use python2.7. Also if I just let the python2.7 script run, it works. Only in conjunction with ros I get this error. But I think I take the python version from the same folder.
Thank you

Cannot install "psycopg2" on Windows 10 with Python 3.8

Yesterday I uninstalled python 3.7 version by mistake. Then I install python again (this time 3.8 version) and again set up my environment. But I could not start my Django project which has Postgres connection. Actually I cannot install "psycopg2" in my environment. I searched for hours and implement every solutions I get from online but it does not work. Let me tell you what I did so far.
First it said to add Postgres in my PATH so I added C:\Program Files\PostgreSQL\12\bin\ in my PATH.
A new problem then arise with a huge ERROR report with 2 vital Error.
ERROR: Failed building wheel for psycopg2
..........................
Running setup.py install for psycopg2 ... error
I try to upgrade wheel but it says,
Requirement already up-to-date
http://initd.org/psycopg/docs/install.html#install-from-source
I learned from this site that psycopg2 requires python2 version. So I installed python 2.7 also.
I reinstalled PostgreSQL but it does not work.
I deleted my virtual environment and create again but it does not work.
Some says they solve this problem by running pip install psycopg2-binary But it does not work for me.
Please help me to get rid of this. I stuck for hours.
When you asked this question, Python 3.8 had been released very recently so there were not any wheels for Python 3.8 yet.
At the time, my suggestion was to install Python 3.7.X and install the binary wheel with:
pip install psycopg2-binary
Since then, binary wheels have been released for Python 3.8, so the above command should work with Python 3.8.X as well.
I wouldn't try to build from source on Windows if it can be avoided.
Finally, you misunderstood the section of the docs about Python 2. You only need Python 2.7 if you are running Python 2. For Python 3, which you should be using for all new projects, it currently supports Python 3.4 to 3.8.
use:
sudo apt install python3-dev libpq-dev
then try doing:
pip3 install psycopg2
Hope it works for you!!
This problem mainly occurs due to this -- " error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/"
Now to install psycopg2, first you need to install visual studio from Microsoft - https://visualstudio.microsoft.com/visual-cpp-build-tools/
now you need to install the c++ desktop development tool with all its default components selected.
After successful visual studio c++ desktop development kit installation, you can now install psycopg2 successfully in your machine.

Will I still able to install dependency package via Pip after Python 2 End of Life in 2020?

I'm using Python 2.7 and python pip to download all dependency packages from requirements.txt file for running my project. As we know the end of life of Python 2 in 2020, I have concern I could not install my dependency package from pip as pip install -r requirements.txt anymore.
One way I could think of is download all dependencies from requirements.txt and install them locally. Is it possible?
I have read a similar question Will PIP work for python 2.7 after its End of Life on 1st Jan 2020, but the possibility is still not clear for me whether or not pip still be working or not after 2020 EOL of Python 2.
How could I confirm that? How could I do to keep dependencies still be installed via pip in 2020 end of life of python 2? Thanks
As seen in the question you linked, the pip maintainers are willing to support Python 2.7 for as long as reasonably feasible. Now you need to consider the other side: the index.
The default index for pip is PyPI, and I can't imagine that they would decide to delete existing artifacts or stop serving them just because the corresponding interpreter reached their end of life. I am pretty sure they already host and serve artifacts that are aimed at Python interpreters that have already reached their end of life. See for example the artifacts for lxml version 3.4.4 clearly show that it is still serving files aimed at Python 2.6 and 3.4, both of them have alredy reached EOL.
One way I could think of is download all dependencies from requirements.txt and install them locally. Is it possible?
This is definitely feasible as well. You could even go a step further and host your own index. See the following links for ideas:
https://packaging.python.org/guides/index-mirrors-and-caches/
https://packaging.python.org/guides/hosting-your-own-index/
https://pypi.org/project/devpi/
https://pypi.org/project/pypiserver/

Installing Biopython in new installation of IPython/Python2.7 [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
I have Python2.7 installed and was having some issues with installing scipy. Through some Googling, I figured from a thread here (installing scipy on mac 10.6.8) that it is better to install scipy using MacPorts and IPython.
IPython looked cool and I wanted to try it. So far, too good - I feel great and elated that I could do all this by myself.
Now, I had Biopython installed with my Python2.7 (this version of Python2.7 was installed in a folder /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7).
In my overzealousness to try Ipython, I (think) I re-installed Python2.7, along with IPython, scipy, etc in a new directory /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7.
However, now I don't have Biopython in the new installation of Python2.7. So do I have to re-install Biopython in the new installation of Python2.7?
And if yes, how do I direct the installation to this folder?
Would it be like the following (say I have biopython-1.61.tar.gz in the folder Downloads):
cd Downloads
tar -xzvpf biopython-1.61.tar.gz
cd biopython-1.61
/opt/local/Library/Frameworks/Python.framework/Versions/2.7/bin/python setup.py install
I would like to hear if I am of-base here. Do not want to try and screw-up what I have so far!
I have Mac OS X V10.6.8.
The following worked for me (from MacPorts Python installation on Mac):
Make the Python2.7/iPython2.7 installation I performed using MacPorts the default
$ sudo port select --set python python27
$ sudo port select --set ipython ipython27
Check if Biopython is available through MacPorts
$ port search biopython
Install Biopython
$ sudo port install py27-biopython # install Biopython
One of the toughest things for someone new to Python is figuring out the installation of all of the packages. It's a work in progress that is actively being discussed by the Python community.
I would recommend going with a commercial distribution that gives you everything you want that just works. This way you can start learning to work with Python instead of having to figure out how to get everything working.
I would recommend:
https://www.enthought.com/products/epd/free/