Python Forum
Problems and doubts with Anaconda and Spyder
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problems and doubts with Anaconda and Spyder
#1
Hello again!

I apologize if this is not the right forum for the following problems and doubts.

I was still using Python 3.7.4 for my little simple programs, but I decided to update and use the latest version of Python installing Anaconda, following the instructions of a book. The author said that Anaconda comes with VS Code. Instead, Anaconda provides Spyder, which is fine with me.

I ran one of my old little programs (that I pasted on the left pane of Spyder) by pressing the play button (the little green triangle) and it worked smoothly on the bottom right pane, while on the top right pane some data appeared coloured indicating if the numbers were part of a list or single integers.

Now, my list of doubts and problems:

1) When I launched Spyder from the Anaconda Navigator, a command window pops in and out 6 times, and then it is kept opened, displaying something like "Active code page: 1252" and if I close that command window, Spyder also closes. Is that normal?

2) While using Spyder, a window pops up suggesting to update. It says not to use pip, as it will break my installation. Is that true?

[Image: New-Spyder-version-5-3-3-available.png]

3) So I followed the instructions and use "conda update anaconda" instead. There were a few minor problems but it seemed fine. Then I tried to update Spyder from version 5.2.2 to version 5.3.3, as suggested and using "conda install spyder=5.3.3" and all kind of conflicts appeared. It took ages to finish (more than 4 hours!, as I left and did other things). This is just a tiny portion of endless conflicts found:

[Image: Endless-conflict-with-packages-for-anaco...-5-3-3.png]
Is that normal?

4) At the beginning of the countless hours that my computer spent trying to update the program, I saw on the command window that some packages were upgraded (something I would expect), but also with other packages, it said they were downgraded (something I would never expect in an update). Is that correct?

5) After all those endless problems, I checked if Spyder had been updated. First from the Anaconda Navigator, but as you can see from the images, it is the 5.2.2 version. I even checked after I launched it:

[Image: Anaconda-Navigator-with-CMD-Promp-and-Sp...icated.png]

[Image: Spyder-IDE-version-5-2-2.png]

Also, when I launched it from the start menu of Windows, it is still the version 5.2.2. Does that mean that I haven't managed to update Spyder to version 5.3.3?

6) Do I try again to update it or I shouldn't bother? I look for answers somewhere else and I found something that maybe I could use, dalthviz at github.com advised:

Quote:if you want to install Spyder 5.3.3 through conda, you will need to create a new environment. To do that, you can run something like the following from an Anaconda prompt:

conda create -n spyder-533 python=3.10 spyder=5.3.3

Then you will need to either activate the env and launch from it Spyder by running on an Anaconda prompt something like:

conda activate spyder-533
spyder

https://github.com/spyder-ide/spyder/issues/19965

I guess, in my case, it would be "python=3.9.13" instead of "python=3.10".

As I was a bit worried, I decided to check here, before I make a disaster with my computer.

Sorry for the long post, and thank you very much in advance.
newbieAuggie2019

"That's been one of my mantras - focus and simplicity. Simple can be harder than complex: You have to work hard to get your thinking clean to make it simple. But it's worth it in the end because once you get there, you can move mountains."
Steve Jobs
Reply
#2
The answer i will give is to forget all you done before,and do some command,
then will all work and you will have a new Spyder version and eg a newer python 3.10.8 version.
Very important always work from a active enviroment when using Anaconda/Miniconda.

From start i use Miniconda just the same commands with Anaconda.
Can do it cmd as don't like at all,as i use cmder always when is on Windows.
G:\>cd miniconda3
G:\miniconda3>cd Scripts
G:\miniconda3\Scripts>activate
(base) G:\miniconda3\Scripts>cd ..
(base) G:\miniconda3>
So now is (base) enviroment active.
Making the new eviroment,with some basic stuff and see that also install Spyder.
conda create --name my_env conda spyder jupyterlab pandas pygame python=3.10.8
Now activate it and start Spyder form enviroment.
(base) G:\miniconda3>activate my_env
# see that (my_env) is activate,start spyder
(my_env) G:\miniconda3>spyder

So this is all stand alone(conda enviroment) and what i have installed before dos not matter at all,this now a new Python and Spyder version.
[Image: WRQqmv.png]
Reply
#3
Hi!

Thank you for your kind help!

First, I think I cleaned everything from anaconda and Spyder. They said there was an uninstaller on the Start list, and there wasn't, but I found it inside the Anaconda3 folder. It didn't erase everything though, so I had to manually look for and eliminate the items on the Start list, on the control panel and some other files I found in "myName" folder inside "Users" (the dates helped ), like matplotlib, jupyter, calibre library (for the JSON files), Spyder and a few more.

I then quickly checked on the book what was needed to follow up with their instructions, and I found Jupyter notebook, instead of Jupyterlab as you suggested. I did a further search on the net, and it seems that Jupyter notebook is now deprecated. So I decided to follow your instructions step by step.

I even used Cmder and typed "cd miniconda3" (without the quotes) and a message appeared saying something like "The system cannot find the specified path."

What should I do then?

Thanks again,
newbieAuggie2019

"That's been one of my mantras - focus and simplicity. Simple can be harder than complex: You have to work hard to get your thinking clean to make it simple. But it's worth it in the end because once you get there, you can move mountains."
Steve Jobs
Reply
#4
Hello again!

I tried a new approach, as I had also problems as commented on the last post.

As I hope to have cleaned up everything from anaconda and Spyder, I download and execute the miniconda installer for Windows from:

https://docs.conda.io/projects/conda/en/...ndows.html

and then from the new Anaconda Prompt (it seems that doesn't change for miniconda) I followed your instructions again:

[code]
(base) C:\>cd miniconda3
(base) C:\miniconda3>cd Scripts
(base) C:\miniconda3\Scripts>activate
(base) C:\miniconda3\Scripts>cd ..
(base) C:\miniconda3>

[\code]

Sorry, it seems I cannot edit it as "code".

Well, that part went without problems, but when I tried to create the environment, then I had problems again. I guessed I did something wrong, so I tried both, from:

[code]
(base) C:\>conda create --name my_env conda spyder jupyterlab pandas pygame python=3.10.8
[\code]

and

[code]
(base) C:\miniconda3>conda create --name my_env conda spyder jupyterlab pandas pygame python=3.10.8
[\code]

as I was not sure where I should write that command. On both instances, there was the same problem:

[Image: problems-with-miniconda-installation.png]

So it seems that pygame is not available and that the environment couldn't be found.

I'll try a few more things and keep you informed of the results.

Thanks,
newbieAuggie2019

"That's been one of my mantras - focus and simplicity. Simple can be harder than complex: You have to work hard to get your thinking clean to make it simple. But it's worth it in the end because once you get there, you can move mountains."
Steve Jobs
Reply
#5
(Feb-06-2023, 04:59 PM)newbieAuggie2019 Wrote: I even used Cmder and typed "cd miniconda3" (without the quotes) and a message appeared saying something like "The system cannot find the specified path."
You most of course use your path to your Anaconda installation,the example i give was with Miniconda(as i mention the command is the same in Anaconda).

Here for start with Anaconda that have on other Pc.
C:\
λ cd Anaconda3\
C:\Anaconda3
λ cd Scripts\
C:\Anaconda3\Scripts
λ activate.bat
(base) C:\Anaconda3\Scripts
λ cd ..

# See that (base) s now active.
(base) C:\Anaconda3
λ conda list Spyder
# packages in environment at C:\Anaconda3:
#
# Name                    Version                   Build  Channel
spyder                    4.1.4                    py38_0
spyder-kernels            1.9.2                    py38_0
So you see that Anaconda come with Spyder and this version use Python 3.8.
Will not use that so a new version Python and Spyder,with this command.
Most add -c conda-forge to avoid confilcts when use Anaconda.
(my_env) C:\Anaconda3
λ conda create --name my_env -c conda-forge spyder jupyterlab pandas pygame python=3.10.8
Collecting package metadata (current_repodata.json): done
.....
When install is finish change to my_env,and test versions not in Anaconda folder.
(base) C:\Anaconda3\Script
λ activate my_env

(my_env) C:\Anaconda3                                                               
λ cd ..                                                                             
                                                                                    

# Test versions
(my_env) C:\                                                                        
λ conda list spyder                                                                 
# packages in environment at C:\Anaconda3\envs\my_env:                              
#                                                                                   
# Name                    Version                   Build  Channel                  
pyls-spyder               0.4.0              pyhd8ed1ab_0    conda-forge            
spyder                    5.4.2           py310h5588dad_0    conda-forge            
spyder-kernels            2.4.2           win_pyhd8ed1ab_0    conda-forge 
                                                                                    
(my_env) C:\                                                                        
λ python -V                                                                         
Python 3.10.8                                                                       
                                                                                    
(my_env) C:\                                                                        
λ pip -V                                                                            
pip 23.0 from C:\Anaconda3\envs\my_env\lib\site-packages\pip (python 3.10)          
                                                                                    
(my_env) C:\                                                                        
λ conda -V                                                                          
conda 4.9.2                                                 

See that now have Python 3.10.8 and new the newest Spyder version 5.4.2.
Reply
#6
Update:

By now, I have installed and uninstalled miniconda several times (I also discovered that there were programs listed in the Start menu not yet erased, like anaconda and miniconda files, further down on the list, and I found also a Jedi file somewhere else, associated to them). At least I'm getting good at locating and uninstalling files associated to a program... Wall

On the last try to install miniconda, I checked the option "Just for me" as choosing the option "for all users" gave me problems on the command prompt trying to include some packages, saying that I didn't have the priviledges to do so.

With so many problems I tried:

[code]
(base) C:\Users\MyName\miniconda3>conda create --name {my_env}
[\code]

Sorry, the option to mark the text as "code" seems still not to be working on this site.

Speaking of sites, I got the idea of creating an empty environment and tweaking your suggested code, (as creating an environment + specific python version option from the same website didn't work) from:

https://www.machinelearningplus.com/depl...vironment/

Then, I activate the environment, and this time it worked!:

[code]
(base) C:\Users\MyName\miniconda3>conda activate {my_env}
[\code]

After that, and from there, I installed one by one, the following: python 3.10.8, spyder, jupyterlab (which incidentally seems to be jupyter notebook and not jupyterlab), and pandas, writing as down here for each one of them:

[code]
({my_env}) C:\Users\MyName\miniconda3>conda install python=3.10.8
[\code]

About pygame, as it couldn't be found before with conda, and I saw that one of the packages installed with python 3.10.8 was pip, I wrote the following, and it worked!:

[code]
({my_env}) C:\Users\MyName\miniconda3>pip install pygame
[\code]

I'm not sure, but maybe when I created the environment, I shouldn't have put the name between curly brackets (maybe the site meant just the name without the curly brackets). But as I'm so clumsy and naïve, I make assumptions (often wrong) if everything is not clearly specified... Confused

I have to see if everything is working fine together. Also I'm wondering that if I installed all that inside an environment, if I create another environment or try to work with one of those programs outside the environment, maybe they won't work... Think

By the way, when I tried to run spyder this time (it hadn't happened all the previous times I used it), my free Avast antivirus blocked it, saying that pythonw.exe was infected with IDP.Generic, but as many people who are more knowledgeable than me, use it, I was a bit suspicious about that warning, so I checked the file on the following free site:

https://vms.drweb.com/scan_file/

and it came as clean.

Once again, I want to thank you again for all your help. I also want to apologize for my long posts, as I tend to explain everything to the last minute thing, but as we are community, my questions might help others if they are so clumsy as I am (difficult to find somebody as thick as me, though... Big Grin ).
newbieAuggie2019

"That's been one of my mantras - focus and simplicity. Simple can be harder than complex: You have to work hard to get your thinking clean to make it simple. But it's worth it in the end because once you get there, you can move mountains."
Steve Jobs
Reply
#7
Quote:You most of course use your path to your Anaconda installation,the example i give was with Miniconda(as i mention the command is the same in Anaconda).

Sorry, I saw that you signed off, and I assumed you went off to bed. I missed your post, probably you did it during one of my multiple times installing or uninstalling miniconda, or while I was editing my post for quite a long time.

I think I used miniconda, but maybe, as I said in my previous post, I saw some undeleted anaconda files, and somehow I messed up trying to follow your suggestion. Sorry also for that.
Thanks for your care and time,
newbieAuggie2019

"That's been one of my mantras - focus and simplicity. Simple can be harder than complex: You have to work hard to get your thinking clean to make it simple. But it's worth it in the end because once you get there, you can move mountains."
Steve Jobs
Reply
#8
(Feb-06-2023, 09:08 PM)newbieAuggie2019 Wrote: Sorry, the option to mark the text as "code" seems still not to be working on this site.
With 200 post you should know that it's [python] and not [code] Wink
Just use the python icon python in editor
(Feb-06-2023, 09:08 PM)newbieAuggie2019 Wrote: I'm not sure, but maybe when I created the environment, I shouldn't have put the name between curly brackets (maybe the site meant just the name without the curly brackets). But as I'm so clumsy and naïve, I make assumptions (often wrong) if everything is not clearly specified
Yes,it's best to call something like eg new_env,so know that if it end with _env it's a conda.
Can just delete enviroments and make new ones with eg Python version you want,that's the power of conda.
So if want test out python 3.11 just make enviroment with it,enviroment with conda is stand alone.
conda create --name new_env -c conda-forge spyder python=3.11.1
Tips always work with enviroment activated when install or eg start Spyder.
If work with other ediotrs point to the python.exe in the eviroment.
Eg i use VS Code and it will auto detect eviroment.
[Image: g00YlW.png]
Reply
#9
(Feb-07-2023, 12:59 AM)snippsat Wrote: With 200 post you should know that it's [python] and not [code] Wink
Just use the python icon python in editor

Yes, you are completely right. The only excuse I can give it's that I think the last post I made before this thread, was almost 3 years ago!!! (How quickly time passes!) That's why I had to check an old post of mine to see how to post an image and even to check what website I used to make the images permanent!!!

But probably it's also because I am a bit dumb (only a bit??? hmm... Undecided ).

During my lack of posts, the website was renovated and I even find now difficult to log in and out. Oh, well... Doh

Okay, now a new update. Yes, you are again right, I shouldn't have put my_env between curly brackets. The truth is that after my suspicions, I once again uninstalled and installed miniconda (blimey, after so many times, now I can do it in a few minutes!!! Dance ) creating again a new my_env, but this time without the curly brackets. I used an old program of mine to check Spyder and I did some modifications to include colorama (yes, I'm a very visual, coloured-minded student Cool ), and it was very nice to see a dialogue between the computer (bright green) and the user (bright cyan). Previously I used the program without colorama on IDLE and the dialogue was in blue and black, but it's not the same as with other colours in other IDEs, like Spyder.

(Feb-07-2023, 12:59 AM)snippsat Wrote: So if want test out python 3.11 just make enviroment with it,enviroment with conda is stand alone.

I think I'm going to wait a bit longer for that, I read that Python 3.10 is going to be deprecated in about 3 years and a half, so I'm not in a rush. Besides, I already tried to force install the last version of Spyder, Spyder 5.4.2, and it gave me some troubles and finally I was not able to install it, so unless it's something imperative, I can give it a pass in the meantime.

I still have to see how to use the Jupyter notebook/Jupyterlab, but it would be a bit further on with the book I'm using now.

From this experience, I have learnt (apart that it seems I cannot follow a few simple instructions... Wall ):

  • To install and uninstall quickly miniconda (and other programs and their associated files now).
  • How to create an environment inside miniconda.

With this new knowledge, I visualize environment as boxes or better, rooms. In each room you have one project (maybe more?) working with these tools (programs), like let's say, Spyder 5.2 and python 3.7 (if they are compatible or were at the time of that project). You activate this environment, if you want to work in this room, but you can deactivate this environment, and go to another room (environment), activate it, and here you could work with let's say Spyder 5.3 and python 3.10. When you want to leave this room, you deactivate the environment, and go to another room, if you want.

That also means two things:

  • You cannot (or want to) work with a project outside the room (environment) where it was created (imagine one enviroment where you are still using, as it seems, theoretically possible, python 2, which wouldn't work, most probably with other projects, with different requirements).
  • As you work along time, you would have eventually many projects, in different rooms (environments), with their own specific versions of, let's say, python (and other programs), which although it seems good to work with, it will also increment hugely the size of miniconda (think about having 6 versions of python, 4 versions of Spyder, 2 versions of Jypyter and so on).

I feel the effect of my coffee intake has almost worn off completely, so it's time to say “Hasta la vista, baby!”.

Thanks again for all your help,
newbieAuggie2019

"That's been one of my mantras - focus and simplicity. Simple can be harder than complex: You have to work hard to get your thinking clean to make it simple. But it's worth it in the end because once you get there, you can move mountains."
Steve Jobs
Reply
#10
(Feb-07-2023, 05:52 AM)newbieAuggie2019 Wrote: I still have to see how to use the Jupyter notebook/Jupyterlab, but it would be a bit further on with the book I'm using now.
When have made a eviroment like eg this,then this could be your main eviroment that use most stuff.
This is what i do have one main one,and can spin up other(then just delete) if want test other stuff.
conda create --name my_env -c conda-forge spyder jupyterlab pandas pygame python=3.10.8
When enviroment is active it easy to start Jupyterlab or Spyder.
I have one command that start and activate enviroment in one go.
G:\miniconda3\Scripts\activate.bat tom_env
When in eviroment it just jupyter lab or Spyder to start them.
# One command to start enviroment
G:\div_code
λ G:\miniconda3\Scripts\activate.bat tom_env

# Start Jupyter NoteBook
(tom_env) G:\div_code
λ jupyter lab
[I 2023-02-07 13:31:57.910 ServerApp] jupyterlab | extension was successfully linked.

# will open automatic in Browser or use link under
http://localhost:8888/lab?token=0f58099c75d5a8a7fde5c1623de09d1a9a32c50862616bbc
or http://127.0.0.1:8888/lab?token=0f58099c75d5a8a7fde5c1623de09d1a9a32c50862616bbc

# Start Spyder
(tom_env) G:\div_code
λ spyder
So it easy now it only use jupyterlab or Spyder in this envioment(which is the main one),what you haver installed before dos not matter at all.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Update Anaconda and Spyder?? Tuxedo 6 7,015 Feb-14-2021, 06:02 PM
Last Post: Tuxedo
  Notepad vs anaconda spyder or python shell ShadowAlpha 2 2,962 Jun-26-2019, 06:31 AM
Last Post: perfringo

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020