Hume argues that causal principles cannot be established on the basis of reasoning (E 4.18, SBN 35):
All reasonings may be divided into two kinds, namely, demonstrative reasoning, or that concerning relations of ideas, and moral reasoning, or that concerning matter of fact and existence. That there are no demonstrative arguments in the case seems evident; since it implies no contradiction that the course of nature may change, and that an object, seemingly like those which we have experienced, may be attended with different or contrary effects. May I not clearly and distinctly conceive that a body, falling from the clouds, and which, in all other respects, resembles snow, has yet the taste of salt or feeling of fire? Is there any more intelligible proposition than to affirm, that all the trees will flourish in December and January, and decay in May and June? Now whatever is intelligible, and can be distinctly conceived, implies no contradiction, and can never be proved false by any demonstrative argument or abstract reasoning à priori.
He holds instead that they are based on experience, and in particular custom or habit. Lady Mary Shepherd has a very large number of arguments against almost every step in this reasoning (e.g., she rejects the idea that because we can imagine something we can be sure it could really happen), but she also argues that the reasoning as a whole is circular (ERCE 87):
Now shortly the whole of this reasoning concerning the possibility of nature altering her course, is but a circle! for the argument is invented to show that CUSTOM and not REASON, must be the only ground of our belief in the relation of Cause and Effect.--But it is impossible to imagine such a change in nature, unless reason were previously excluded as the principle of that relation;--and it is impossible to exclude reason as the principle of that relation, except by supposing that nature may alter her course.
The particular course of the circle, as she sees it, seems to be the following;
(1) The idea of causation is founded only on experience.
(2) That this must arise due to custom and not reason is seen in the fact that we can conceive an uncaused change in nature without contradiction.
(3) This uncaused change in nature is only without contradiction if we suppose causal inference to be based only on custom.
Whether or not it is a contradiction to assume an uncaused change in nature presupposes an answer to the question of whether our causal inferences are based on reason or custom. If they are based on reason, then there is in fact a contradiction in a change of nature occurring without a cause. It's true that something looking visibly like snow can fall from the clouds and have the taste of salt and the feeling of fire, but it would be a contradiction to hold that what we generally call 'snow' can have the taste of salt and the feeling of fire -- anything, however snow-like in appearance, that had other properties too un-snow-like would not be snow. (You can make Crisco look like vanilla ice cream, but it does not follow from this that vanilla ice cream can taste like Crisco while still having all the other features of vanilla ice cream. Good eggs and bad eggs look alike, but that doesn't mean that you could have a good egg and a bad egg exactly alike in every way except that one happens for no reason at all to be good and the other happens for no reason at all to be bad.) It's possible to have our trees flourishing in December, but it is not possible for them to do so while everything about trees and seasons remains exactly the same. So we can make sense of saying that it is contradictory for nature to alter its course in these ways; the only reason whatsoever why we would deny it is if we are already assuming that the inference is not a rational requirement, for instance, by just assuming that it is something based on habit rather than reason.
Shepherd elsewhere argues that Hume is inconsistent on how causation interacts with his empiricism, sometimes treating all sensible qualities as effects as bodies and sometimes treating sensible qualities as effects of other sensible qualities. This is perhaps connected to the question of circular reasoning here, since if you treat sensible qualities as the causes of other sensible qualities it's easier to see how you would make Hume's argument. If you assume that snow-whiteness is the cause of snow-coldness, then the fact that you can obviously have snow-whiteness without snow-coldness, and indeed, with a feeling of heat, would show that there is no contradiction in deviation from the usual causal course. But of course, nobody thinks that snow is caused to be cold by being white; the fact that you can have one without the other is not any kind of deviation from the course of nature at all, but only a reflection of the fact that snow is not the only possible white thing.
When I was a young boy, I asked my parents if we could have the orange in the refrigerator. They replied that there was no orange in the refrigerator. I opened the refrigerator and showed them the orange. They replied it was not an orange. Finally, my dad cut it and gave me a slice. It was very, very sour. (He made me eat the whole slice, too.) Now, that fruit looked exactly like an orange: it was not elongated like a stereotypical lemon, but fairly round, and it was not brilliantly yellow like a stereotypical lemon, but I saw it as light orange (and remember it as light orange to this day). But it was not an orange that inexplicably tasted like a lemon; I had simply identified the wrong kind of cause. Looking like an orange is not the same as being an orange.
We don't expect roses to bloom in New York in January; but we don't take this to be because it is a certain month of the calendar, but because of cold and the internal structure of rosebushes. If you go to Texas, sometimes roses do bloom in January; but the obvious reason is not that the course of nature changes between New York and Texas but that Texas, being positioned differently relative to the sun and the arctic, is less consistently cold in the same month that New York is very consistently cold. We can imagine what looks like ordinary roses blooming in the midst of what looks like a lot of ice and snow; but this is only the same as imagining actual ordinary roses to be blooming in the midst of actual ice and snow if we ignore a lot of other things that are found in roses and snow. We simply can't imagine to a level of detail that includes all relevant qualities of both roses and icy snow. What we can imagine is that you could at least have a magic trick or illusion where it looked like it happened, just like there are situations in which you could make a lemon look like an orange, which is a very weak result. At least, this is all true unless you assume that the causes and effects here are just the imaginables themselves; our association of one sensible quality with another is due to the fact that we are familiar with their conjunction in experience, so then you would take this to apply to the causes and effects as well.