I'm aware that a good deal of Europeans lived in Africa, but there was never any great influx of white settlers who stayed post-independence. The only exception I suppose would be South Africa, but unlike the Americas or Australia, it never became wholly European in culture or ethnicity. What was the reason Africa was left alone while other continents were settled?
So the source I have for this isn't great - the textbook I used for my world history class. While there is plenty more nuance to be found, I can cover the basics.
1) There were already Africans there: Or, perhaps more specifically, there were African political and economic entities that survived contact with Europeans on the coast. The smallpox-induced demographic collapse that paved the way for European expansion in the Americas never occurred in Africa. This meant that there were people Europeans could trade with for commodities - including enslaved people - rather than move over in large numbers to settle and extract themselves. European footholds in Africa were just that prior to the mid-19th century: small forts and trading posts (factories) where they could negotiate with Africans.
This also meant that there were enough people around and well-organized enough to militarily resist European expansion.
2) Terrain and Environment: Europeans, by their own estimation in the 15th-19th centuries, did not do well in warm climates. Malaria and Yellow Fever took terrible tolls among European traders and slavers, and Africa (and the Caribbean) quickly acquired reputations as fatal climates for non-Africans.
The terrain of Africa also seemed to discourage outsiders. Steep mountains or dense jungle (or both!) came near the coast in many places, limiting colonization efforts to a relatively crowed coastal plain. Ocean-faring ships could not deeply penetrate the continents swift, narrow rivers very far so long as the relied on sail. Which brings us to our last point.
3) There were other places to go: The extractive nature of European colonies in Africa meant that a relatively small number of Europeans were needed to administer the colonies; labor would be provided by natives. If one wanted to chase gold rushes or set up a new farm, America was likely a better choice. If one didn't mind sweltering heat, mosquitos, and being outnumbered by black people, the Caribbean sugar islands offered a more proven source of large and steady income. By the time that steam engines and quinine (anti-malaria medicine) made penetration of the African interior practical, most Europeans were able to access once-rare products from around the world locally. Many of the factors that prompted European emigration to inhospitable climates in the 16th-18th centuries did not exist in the late 19th century.
Kevin Reilly, Worlds of History.
The only exception I suppose would be South Africa, but unlike the Americas or Australia, it never became wholly European in culture or ethnicity.
This was not for lack of trying, at least in the sense of creating the image. The parallels between settler mythos in the US, Canada, Argentina, NZ, Australia, and even Algeria with those in South Africa are fairly remarkable. SA also had a low population density west of the 20cm isohyet, and a sub-Mediterranean climate around Cape Town, with limited incidence of malaria and virtual absence outside the Limpopo Valley and the Escarpment (today parts of Limpopo and Mpumalanga). So the claim of taming a 'savage land' and gaining the right to it in that way was very much part of the beliefs of white settlers in South Africa--not just Afrikaners (literally, "Africans") but even the English to a certain extent. Beliefs about South Africa being totally empty when Europeans arrived (it wasn't) or the majority of Africans being invaders from the last two centuries (they weren't) stem from this desire for a parallel [edit: as in parallel sort of legitimacy, right to the land, etc].
George Fredrickson talks about some of this in his couplet of White Supremacy and Black Liberation; Hermann Giliomee's The Afrikaners treats it; and the comparative angle comes out in a variety of works from Belich's Replenishing the Earth to Weaver's The Great Land Rush and the Making of the Modern World.
None of that erases the fact that South Africa's precursor states, after about 1835-38 and settler expansion into African kingdoms' lands and claims of sovereignty there, were only minority European or mixed Asian-African-European (aka "Coloured") in origin. But they did engage in some serious efforts to downplay it and cast the white population as the only legitimate one. Indeed, grand apartheid's creation of "homelands" was predicated on realizing that belief and cutting black South Africans out of SA entirely.
As far as climate goes, though, it's worth pointing out that Africa consumes a lot of white maize. It grows well in a lot of environments--especially in SA. So by the time European settlers were really pushing far into those areas, there were already functioning African growers of food and cash crops alike (in E. and W. Africa for the latter--coffee and cocoa production were hard for Europeans to break into without lots of government intervention).
A good quick read on this subject (and similar cases) is Prisoners of Geography by Tim Marshall.
A few brief points on Africa;
Europe and North America largely have great harbours and river networks which Europeans dominated. The fact that they brought the disease to NA instead of being affected by it also helped in overrunning the locals.
It looks like you are asking three questions: 1) Why didn't Europeans settle in the African colonies, 2) Why white immigrants didn't stay in Africa post-independence of former colonies, 3) Why was Africa "left alone" while other continents were settled.
My answer will focus on the second question because the answer to the first question is largely due to geography (deserts and jungle/malaria - you can refer to any map of Africa to see the deserts and jungle/malaria was something Europeans had a hard time coping with before the invention of quinine [see: Daniel Headrick The Tentacles of Progess: Technology Transfer in the Age of Imperialism, 1850-1940 (New York: Oxford UP, 1988), pp.231-2]), and becayse you already also because you understand that a large number of Europeans did immigrate to Africa.
As far as the third question goes, I think it is fair to so that Africa wasn't "left alone". Consider the Belgian Congo. Consider the white settler colonies. Consider the Herero genocide. Consider the invasion of Ethiopia.
To answer the second question, let's begin by surveying the countries that had large white immigrant populations: South Africa, Rhodesia, and Algeria. Algeria's "white" population (the government didn't classify inhabitants as being "white" or "non-white") was around 10% at the time of independence (don't have the book at my fingertips, but see A Savage War of Peace: 1954-62, by Alistair Horne), Rhodesia's white population (the government very much did classify inhabitants as being "white" or "non-white") was around 5-7% in 1970 (see: Collapse of Rhodesia: Population Demographics and Politics of Race by Josiah Brownell), and South Africa's white population was around 25% (tired of looking for sources that confirm what I know to be true - the 1936 National Encyclopedia confirms this, but its not a scholarly source).
Moving forward: in each case the white minority government (there's a bit of nuance in the case for Algeria, because they didn't use race as a litmus lest - they basically said "you can either live under French civil law or you can live under a legal system based more on Islamic law" [again, from Savage War of Peace]) tried to cling to a system of power which was heavily tilted to the colonizing people.
So what happened at independence? Well, this is the part I won't address because, to be frank, I'm exhausted and didn't realize I would have to type so much / do so much fact-checking.
Sorry.