I’m just getting started with streamlit and I notice the installation instructions suggest creating an environment with conda, then opening a terminal window in that environment and using pip to install streamlit.
But why don’t we just install it with conda? In Anaconda I can see a package called streamlit. Wouldn’t it be better to install streamlit directly with conda, along with any other packages I need to use in building my streamlit-based application?
You will find a lot of opinions regarding installing with pip or conda in a conda environment.
From my experience of mixing pip and conda installed packages in the same environment, this blog post has been the closest to my experience:
You’re fine to use either pip or conda, but try to stick to only one of the 2 in the same environment. There were times for me where conda install of a package did not resolve pip dependencies very well and vice-versa (they don’t use the same dependency resolver), and you could end up mixing and breaking versions of a dependency.
I use pip for all Python packages, almost all packages deploy first on PyPi then on Conda, so you have more chances of the pip install being the more recent version than the conda one (in fact it’s possible the streamlit conda is not the most recent one) (this is not always the case for all packages, but like for me it was 85-90%)
I use conda for non Python packages (like git or openjdk) or packages that pip can’t install on Windows but conda can, generally because of compiled extensions like C++ dependencies (like pystan on Windows from memory for fbprophet). This is also where you find the 10% conda packages that don’t have a pip install in my experience.
For ML libraries which heavily depend on C++ like pytorch, or which promise specific CPU optimizations like numpy with MKL optimization, I tend to use pip anyways but if it does not work I’ll go with conda
So what I do is always use pip in conda environments, and conda install when pip install did not work for the very specific libraries with hardcore C dependencies
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking “Accept all”, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
Performance cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
Functional cookies
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
Targeting cookies
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.