Q:

pyproj gives inf instead of values

I want to convert the coordinates (639117.49, 6865775.92) from EPSG:4326 to EPSG: 3949, by using the following code:
from pyproj import Proj, transform

P4326 = Proj(init='epsg:4326')
P3949 = Proj(init='epsg:3949')

x,y = transform(P4326,P3949,  639117.49, 6865775.92)

The values should be: 1639190.94757331, 8187869.9312972 but I get inf, inf. 
What is the mistake? 
Otherwise, can I do it directly via PostGIS without using Python?

A:

Your input values look like they are in EPSG:2154 (RGF93 / Lambert-93), according to projfinder. Using this coordinate system and the point 639117.49, 6865775.92, I get a point on Rue Jacques Daguerre in Rueil-Malmaison, France. If this is the correct place then I would try the following:
from pyproj import Proj, transform

P2154 = Proj(init='epsg:2154')
P3949 = Proj(init='epsg:3949')

x,y = transform(P2154,P3949,  639117.49, 6865775.92)

With this transformation, I get values close to your desired result: 1639117.57, 8188002.59

