Spyder IDE plugins installation (spyder-unittest) - python

I am trying to install a plugin for the Spyder ide called spyder-unittest (description here).
I am using:
MacOS X Version 10.14.6
Anaconda Navigator 1.9.7
Spyder 3.3.6
Python 3.7
After a first attempt using the command
conda install -c spyder-ide spyder-unittest
the plugin did not work (i.e. the additional command Run unit tests was not available under the Run menu).
I also tried, without success:
conda install -c conda-forge spyder-unittest
I then uninstalled and installed once again Anaconda navigator, and tried conda install -c spyder-ide spyder-unittest. This time, I got a very lengthy output, indicating conflicts (please see image):
Now, I do not know what to do. Could someone please offer any help?
I also tried to install after going, through the Terminal, to the directory where I thought the Spyder plugins were installed. Same output as above.
Thank you very much in advance.
Cheers,
Orlando

I managed to install spyder-unittest without any errors on my computer.
I suggest creating a new environment to avoid any conflicts with other packages when installing.
First create a new environment using:
conda create --name env python=3.7
After creating the environment, activate it using conda activate env
Then install spyder-unittest using conda install -c conda-forge spyder-unittest

Related

Segmentation fault: 11 when trying to run Spyder in conda environment

I'm setting up a separate environment to work in. However, whenever I try running spyder, I receive this error:
/Users/user/anaconda3/envs/myenv/bin/pythonw: line 3: 84700 Segmentation fault: 11 /Users/user/anaconda3/envs/myenv/python.app/Contents/MacOS/python "$#"
I have no idea what this means. The commands I used to get to this point were:
conda create -n myenv python
conda activate myenv
conda config --add channels conda-forge
conda install -c conda-forge spyder
spyder
I have anaconda navigator installed, and spyder runs fine in the root environment. I do receive the statement "link image0 hasn't been detected!" every time I run it.
I've always used spyder and anaconda, and I've never had these issues before
I was dealing with this same problem for several weeks and spent many days trying to fix it. Of the countless operations I attempted, I finally got spyder to successfully run from its own conda environment without throwing the segmentation fault error you've referenced.
With a fresh install of anaconda3 on macOS 10.14.6, I created a conda environment from the command line just as you’ve shown:
conda create -n myenv python
conda activate myenv
A comment about:
conda create -n myenv python
Note 1: if you list “spyder” to install during the environment creation there’s no need to include “python” as a package unless you wish to have a specific version. For example, “python=2.7.9”, or “python=3.10.*”. Otherwise, python gets added automatically when the environment is created.
Next,
conda config --add channels conda-forge
instead of setting the conda configuration to use the conda-forge channel and instead of including it as a channel when installing spyder into your conda environment, simply install spyder using the virgin (unmodified) default channel configuration by only typing:
conda install spyder
Now when you run spyder from the command line within your active environment it should open as expected.
As previously indicated, you can install spyder during the environment creation:
conda create -n myenv spyder
Then you can activate the environment to test everything:
conda activate myenv
spyder
Note 2: the official spyder documentation recommends including the -c conda-forge channel, but this was the entry that I removed to finally avoid the segmentation fault. I suspect that although the community repository at conda-forge keeps the most up-to-date versions, there are conflicts not being resolved at creation of the new local environment.
Furthermore, you may notice that the method described above installs spyder version 5.3.3 and spyder-kernels version 2.3.3, both of which are not the most up-to-date. You could check this by running conda list from the command line and then searching for the corresponding entries.
However, if you try to update spyder by calling conda update spyder, the system will tell you that all packages are currently installed. This is because the virgin channel defaults are looking at the anaconda repository, not conda-forge. My suggestion for right now is not to attempt updating spyder in your conda environment because it will update other packages as dependencies that will result in breaking the application again.
In case you’re curious, to get the most recent version of spyder based on the procedure I've described above would be by setting the channel as follows: conda update spyder -c conda-forge. Depending on your OS, this will install spyder 5.4.1 and spyder-kernels 2.4.1 (as of 16-Jan-23), but it will also remove and update several other packages, hence causing compatibility issues.
UPDATE:
My key takeaway is to remove the -c conda-forge from the installation line of code to prevent the segmentation fault when using conda. Everything else is up to the user. Installing with pip, brew, or any other method is discretionary but could also result in more trouble than it’s worth for the already frustrated user.
If you run conda create -n myenv spyder at the environment creation or conda install spyder after creating the environment, the packages pyqt and qtpy are installed alongside spyder because they are dependencies and not explicitly needed (unless specifying specific versions). If you run pip install spyder, the packages pyqt5 and qtpy get installed. (as of 16-Jan-23)
Caution:
(with reservation because if you can follow instructions and you are both okay with and the only one affected by the consequences of your choices when things go wrong, I support you to thoughtfully experiment and explore if you so desire)
According to the docs, using pip to install packages within the conda environment is reserved for experienced users. A big reason for this caution is because pip and conda don’t communicate and so package versions and dependencies can become incompatible if the user is not aware of what’s happening. It should also be pointed out that if and when using pip, one should generally install all the desired conda packages prior to installing a package with pip. Problems usually present themselves when updating, or installing with conda after pip. When this becomes necessary the general advice is to start over and install new packages as well as updated versions in a new environment.
Installing with brew is unsupported by the spyder devs. This can be referenced from the spyder documentation.

How to install the specific version of Python with Anaconda?

I want to install Anaconda with Python Version 3.6.5. If I install Anaconda3-5.2.0, It install Python 3.5.1. Where to download the Anaconda with Python 3.6.5. The Big Data Scripts work only with Anaconda Python 3.6.5.
Anaconda Downloads
The Anaconda distribution with Python 3.6.5 was version 5.2.0.1 You can download this from the Anaconda distribution archive. If you do install from this, then make sure to update Conda immediately after installation:
conda update conda
However, I strongly recommend the following alternate solution as better practice.
Miniconda + Anaconda environment
Reasoning
What is installed in the base environment is relatively fixed once installed. Ultimately, you don't want to mess with your base environment, so best practice is to have the latest version there. Fortunately, you don't have to install a full Anaconda distribution, but rather can use a lightweight Miniconda (or Miniforge) distribution and create a secondary environment for the purpose of having an Anaconda Python 3.6.5 distribution. In the long run this will give you better stability.
Steps
Download and install Miniconda or a Miniforge variant. Once that is working...
Create your Anaconda env:
conda create --name my_env -c anaconda python=3.6.5 anaconda=5.2.0
Use your new isolated env:
conda activate my_env
[1] I determined this by running conda create -n foo --dry-run -c anaconda python=3.6.5 anaconda and then examining the version of the anaconda package that Conda ended up with in the solve.
Also try
conda install python=3.6.5
but you may encounter some incompatibility issues with other packages.
Alternatively, you may want to try creating a new environment. From the anaconda prompt, create a custom environment and specify the repository channel to find the version
conda create --name py365 python=3.6.5 --channel conda-forge
Activate the new environment
conda activate py365
However, the activation will not be permanent, and you will need to activate each time you start the anaconda prompt.
In your anaconda prompt, you can manually update your python to the latest version with :
conda update python
In case you are not familiar with it, anaconda prompt is installed to your computer when you install anaconda. Just make a search for it on your computer.
You can refer to this post : How do I upgrade to Python 3.6 with conda?

Conda create is stuck at "solving package specifications"

I'm trying to create a Python 2.7 virtual environment with Anaconda so I can download some packages that are not compatible with Python 3.4. I'm working in Conda version 4.2.13.
When I type the command conda create -n chemistry python=2.7 anaconda the whole thing freezes at the solving package specifications stage.
Does anyone know what causes this or how I can go about fixing it?
Today I faced the same snag. It got fixed after updating my Anaconda Navigator.
Updating your Anaconda Navigator may fix your issue, too.
Try this:
conda create -n chemistry python=2.7
The initial command you use will try to install a package named anaconda. If you want to specify the channel when installing packages,you can add -c <channel>.For example:
conda install -c conda-forge tqdm
Had same issue while I was trying to install some packages. I tried updating python then all seemed working. Try it out
conda install python

tensorflow - cannot install tensorflow from Anaconda

I am trying to access tensorflow from two ways, both of which are failing:
Installed Anaconda (Windows 32 bit Python 3.6). Then, created a conda environment with Python 3.6 (also tried with 3.5) and Tensorflow. Then, I opened Spyder desktop app. In this Spyder, the tensorflow is not working (e.g. 'import tensorflow as tf' is not working).
From Anaconda Navigator, created an environment (using the GUI), with Python 3.6. Then, I filtered the "Not installed" packages, and searched for "tensorflow". I couldn't find any relevant tensorflor package. All I could find is "r-tensorflow" which is not relevant for me.
The attached image describes the 2nd problem.
Can someone help?
Screenshot of the step 2 above
Open an anaconda prompt, and create an environment with tensorflow like this:
conda create -n tf tensorflow
activate tf
# Verify that it works
python -c "import tensorflow"
Then, you probably have to specify that environment from within Spyder. Open Preferences->Console->Advanced Settings and set the python path to <anaconda_install>/envs/tf/bin/python.
tensorflow can be installed simply by running following commands
On mac/Windows use following command:
conda install -c conda-forge tensorflow
This will install the latest Tensorflow on your system. if you wish to upgrade it to newer verion then you can use the following command
conda update -f -c conda-forge tensorflow
However if you have the virtual environment created from anaconda then before doing these steps you have to activate the environment first and then run the command. With this trensorflow will get installed on your specific command
Please refer the example below for more details:
Creating a environment for Tensorflow
conda create -n “myEnv” python=3.6 anaconda
This will create virtual environment along with anaconda packages. Once this is done, Activate the Environment by :
source activate myEnv #(for mac)
conda activate myEnv #(for windows)
you will see the following.
Once the Environment is active. you can now install the packages you need as follows:
I am showing you the packages which i work upon on virtual environment and this will take care of most of your dependencies
conda update conda
conda upgrade conda
conda upgrade anaconda
conda install pip
conda install -c conda-forge opencv
conda install -c conda-forge tensorflow
conda install -c conda-forge keras
Hope this will solve your problem.
Open Terminal, then enter:
conda update conda
After installing done, enter:
conda install tensorflow
It will take some time based on your internet speed.
After installing, open Anaconda -> Spyder/Jupyter
import tensorflow as ts
Let's break it down in a couple of steps:
If you don't have, download and install Anaconda.
Access Anaconda Command Prompt for the environment that you want to install TensorFlow. If you don't have an environment created, access the Anaconda Prompt.
Assuming that you don't have an environment created, choose the name of your TensorFlow environment, such as "tensor" and install TensorFlow as following
conda create -n tensor tensorflow
conda activate tensor
If you want to install the GPU TensorFlow (Linux or Windows), in the environment "tensor-gpu", use the following
conda create -n tensor-gpu tensorflow-gpu
conda activate tensor-gpu
TensorFlow is now installed. For more information access their documentation.
Try to install Spyder within the Anaconda environment in which you want to use tensorflow. This resolved the issue for me.
I had been stuck on the exact same problem for the past 4 days. I could see 'r - tensorflow' and a few other packages but not the 'tensorflow' package. Apparently, i was using the 32 - bit version of Anaconda. I searched it up and found out that Tensorflow is not supported on 32 - bit platforms. So i uninstalled the 32 - bit version and installed the 64 - bit version. I followed the same steps as before and i was able to find the 'tensorflow' package in the 'not installed' tab.
In my case I used pip instead of conda and it installed without any issue. In my opinion pip installation is much faster than conda installation.
Use
pip install tensorflow
and its done.

How to install pydotplus for Python 3.5 on Windows64

What is a proven method for installing pydotplus for Python 3.5 on a 64-bit Windows(10) system? So far I haven't had any luck using conda or a number of other approaches.
It appears there are several viable options for both Linux Ubuntu and Windows for Python 2.7. Unfortunately it's necessary for me to use this particular configuration, so any suggestions would be greatly appreciated!
Try running anaconda prompt as 'administrator', then use:
conda install -c conda-forge pydotplus
What have you tried for conda? According to https://anaconda.org/conda-forge/pydotplus/files pydotplus is available from conda-forge for Windows x64 and Python 3.5. Typing
conda install -c conda-forge pydotplus
should work.
I had definitely tried that earlier but for some reason it wasn't working. However, thanks to your response I took another look at my configuration to see why that particular install package wasn't running properly.
I originally used Anaconda to install a dual Python 2.7/3.5 environment and while I was always able to run 3.5 without any issues in an IDE (Jupyter Notebook in this instance), the current environment had still automatically defaulted to 2.7. The quick way to check for this via the command window is:
C:\Users\Username\Anaconda\envs>conda env list
which should produce something like:
# conda environments:
#
py27 * C:\Users\Username\Anaconda\envs\py27
py35 C:\Users\Username\Anaconda\envs\py35
Note that there will be '*' next to the environment that is currently active. To switch, simply type 'activate' followed by the new desired environment name and the change should immediately be verified by the command prompt that is returned:
C:\Users\Username\Anaconda\envs>activate py35
(py35) C:\Users\Username\Anaconda\envs>
After making the environment change, I reran the conda install package for pydotplus that you mentioned:
conda install -c conda-forge pydotplus
and it worked perfectly!
Two other quick things to consider when installing pydotplus to ensure that it interacts correctly with GraphViz in your particular environment:
Make sure you're running the most up to date version of scikit-learn. More info is provided on the official website (http://scikit-learn.org/stable/install.html), including the quick update command: conda update scikit-learn
Verify that the GraphViz bin directory has been added to your User Path: (Why is pydot unable to find GraphViz's executables in Windows 8?)
I had the same issue. here what I did was,
first I ran the anaconda prompt as administrator and then give the command,
**conda install -c conda-forge pydotplus**
it worked for me well

Categories