To setThe following code should allow you to add a vector layer without the canvas CRS, you can use popup window from appearing (atleast it doesn't appear for me):
from qgis import *
from qgis.utils import *
my_crs#replace ="shapefile_path" core.QgsCoordinateReferenceSystem(4326,with core.QgsCoordinateReferenceSystem.EpsgCrsId)
your layer's path; replace "Layer_name" with whatever name you want to give the layer in the TOC
ifaceqgis.mapCanvas()utils.mapRenderer()iface.setDestinationCrsaddVectorLayer(my_crs"shapefile_path", "Layer_name", "ogr")
To set the layer CRS, you can use:
#Use loaded layer as active layer to set the CRS
myLayer = qgis.utils.iface.activeLayer()
myLayer.setCrs(QgsCoordinateReferenceSystem(4326, QgsCoordinateReferenceSystem.EpsgCrsId))
#Sets canvas CRS
my_crs = core.QgsCoordinateReferenceSystem(4326, core.QgsCoordinateReferenceSystem.EpsgCrsId)
iface.mapCanvas().mapRenderer().setDestinationCrs(my_crs)
Simply change the 4326
CRS value in both cases to the Authority ID of your choice as shown in the image: