Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I am trying to install lightgbm using conda. I successfully downloaded the only version I saw on the cloud(2.2.1) and saw that it forced me to downgrade my mkl. I thought this would be ok, however, when I did this, it broke some other essential functionality (a matplotlib function stopped working).
I was wondering how I might resolve this issue? Also is there a general strategy people tend to use when dealing with this whack-a-mole type dependency problem? Is there something simple that can be done to handle this? Thanks in advance!
The general strategy people use for this problem is working with different environments. When you use different environments for projects, you can install packages for each project you work on seperately, and you will not get into trouble with packages not working anymore for your other projects. It works pretty simple and avoids dependency problems.
To create a new environment use: conda create --name env_name python=requiredpythonversion
Then you should activate your newly created environment: activate env_name
After which you can install to it the packages your project requires: conda install PACKAGENAME, in your case that would be conda install lightgbm
A great tutorial on how to work with python environments using conda (You could also use pip and venv's, but since you seem to be using conda already I assume you want to proceed with that), can be found Here. I recommend you follow it, it will probably answer all the remaining questions you have about package management, and then you will be good to go =)
Related
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 days ago.
Improve this question
I can't import libraries in python that I have installed using pip
as shown here.
Even other libraries such as PySimpleGui and PyGame don't work when I try to import them.
I have tried uninstalling and reinstalling the libraries and I am sure they are installed on my computer.
To sort this out, you need to establish two things:
where you (i.e. pip) installed the packages, and
where Python is looking for them
You can find where pip installed a package with:
pip show PACKAGE # e.g. pip show flask
Obviously, if you install using pip3 install flask, you will need to use:
pip3 show flask
Now you need to see which Python you are running and where it is looking for its packages:
import sys
print(sys.executable) # show which Python we are running
print(sys.path) # show where it is looking for packages
Hopefully you will see you are not installing into the Python interpreter you are using.
I think you might have installed them under a different folder or space than what you need. For example the code below installs the library at your current space, while simply pip3 install pygame might be somewhere else.
python3 -m pip3 install pygame
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 1 year ago.
Improve this question
I am using Pycharm IDE. I am doing a project that requires an older version of Tensorflow. I tried installing in from within pycharm marketplace using specified versions, but it says that there is no matching distributions found. So, I downloaded Tensorflow v1.8 sourcecode from Github as a zip. Now I want to install it in pycharm. How do I do that?
Having an IDE with things like a 'marketplace' is nice in theory, but you'll always end up having to resort to the commandline. Try to open the Terminal in PyCharm, it should activate with the python environment of your project. Then install tensorflow 1.8 with pip install tensorflow==1.8.0
For the latest version
pip install tensorflow
For the previous ones
pip install tensorflow==THE VERSION YOU WANT
pip install tensorflow==1.5
Or with pyCharm
Preferences> Project: PROJECT NAME> Python interpreter
Click on the + symbol at the top left and look for the package you want to install
(At the bottom right you can also check the Specify version box and choose the version you prefer)
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 1 year ago.
Improve this question
Using machine learning models always come with some dependicies like framework or library verison conflicts. And pip verison as getting up, installing some libraries could be suck. What is your pip version? Do you upgrade it always?
It is quite ok if the version is not updated to the latest on every single release.
You will hardly get any problems even if you update the pip every 3 to 4 months.
However I recommend that you should update the pip every month or at least when a major update comes.
For Linux users, If you have a habit of updating your system every month than you should not worry about this explicitly.
first of all, there is no dependency management with pip. Most people use conda as a package manager for python because it automatically checks for dependency compatibility. If you use pip as a package manager you have to do all that yourself which is difficult if not impossible unless you have a ton of sys-admin experience. If you are running into dependency issues I strongly recommend downloading anaconda and using conda package manager. It will make your life a lot easier. cheers.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
Improve this question
I came across a python library which has docs, which start like this:
Quickstart
Include foolib in your requirements.txt file.
AFAIK dependencies should be specified via install_requires in setup.py.
Should I talk the maintainer of the library and create a pull-request for the docs?
Both are acceptable. The difference is that specifying something in your install_requires will auto-download / install that package when you install the package using setup.py. Having a requirements.txt makes it easier to see at a glance what the requirements are. I personally prefer seeing libraries with a requirements.txt, since I can install all those requirements with pip into my virtualenv and be able to update them quickly if needed.
Add your dependencies in a requirements file and then parse this file in the setup.py. This will help you to:
Easily install dependencies without installing the entire package through pip
Get only one source for your dependencies
Get all way to install your package available (pip, easy_install, command line, etc...)
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 11 months ago.
Improve this question
this is a pretty basic question but I'm not really finding any answer, maybe my keywords are wrong...
I've been programming in Python for a little while now and I made a few scripts that are good enough to be deployed in the department where I am working. So... Am I going to have to make everyone install Python on their machines, and then go through the tedium to install all the modules I use in the scripts with pip, or is there a better solution? Obviously I have zero experience with this, so far I've only been working on Visual Studio and running my scripts from there. I would appreciate a couple pointers, the topic is very broad and I feel lost.
It's possible to create a module, as if it's intended for pip, that you do not publish on PyPI, but allow people to install locally.
For example, observe this project on GitHub: pyjokes. It's available on PyPI so you can pip install it. But you can also download the repo and install from source. This would install it as if you'd installed it using pip (because pip is just a wrapper for "download this project and run the installer").
The procedure for installing this project from source would be:
git clone https://github.com/pyjokes/pyjokes
cd pyjokes
sudo python3 setup.py install # python 3
sudo python setup.py install # python 2
Take a look at the way the project is laid out. The essentials are the setup.py file and the __init__.py in the pyjokes folder. That should be enough to make your project installable locally.
Then you can distribute the code (perhaps a private github or bitbucket repository), and use the README to describe the installation instructions.
Note: I've described a Linux installation process, but I'm fairly sure it works the same on Mac too. I'm not sure about Windows.
Python official docs have a lot of info about this.
For 3.x.x Setup script
For 2.7.x Built dist