You can apply from the country of your citizenship or the country where you hold legal residence (a long-term or permanent residence permit). You cannot apply based on a tourist visa. In some cases, if you are already in France, the UK, or Italy, you may be able to switch your residence status from one type to another.